Part Number Hot Search : 
ACNM3112 1N753 YG865C08 D381A LTC1143L LTC1143L BFG19S UFT12260
Product Description
Full Text Search
 

To Download DSPIC33EPXXXGP50X Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  ? 2011 microchip technology inc. preliminary ds70657d-page 1 DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x operating conditions ? 3.0v to 3.6v, -40oc to +85oc, dc to 70 mips ? 3.0v to 3.6v, -40oc to +125oc, dc to 60 mips core: 16-bit dspic33e/pic24e cpu ? code-efficient (c and assembly) architecture ? two 40-bit wide accumulators ? single-cycle (mac/mpy) with dual data fetch ? single-cycle mixed-sign mul plus hardware divide ? 32-bit multiply support clock management ? 0.9% internal oscillator ? programmable plls and oscillator clock sources ? fail-safe clock monitor (fscm) ? independent watchdog timer (wdt) ? fast wake-up and start-up power management ? low-power management modes (sleep, idle, doze) ? integrated power-on reset and brown-out reset ? 0.6 ma/mhz dynamic current (typical) ?30 a i pd current (typical) high-speed pwm ? up to three pwm pairs with independent timing ? dead time for rising and falling edges ? 7.14 ns pwm resolution ? pwm support for: - dc/dc, ac/dc, inverters, pfc, lighting - bldc, pmsm, acim, srm ? programmable fault inputs ? flexible trigger configurations for adc conversions advanced analog features ? adc module: - configurable as 10-bit, 1.1 msps with four s&h or 12-bit, 500 ksps with one s&h - six analog inputs on 28-pin devices and up to 16 analog inputs on 64-pin devices ? flexible and independent adc trigger sources ? up to three op amp/comparators with direct connection to the adc module: - additional dedicated comparator - programmable references with 32 voltage points ? charge time measurement unit (ctmu): - supports mtouch? capacitive touch sensing - provides high-resolution time measurement (1 ns) - on-chip temperature measurement timers/output compare/input capture ? 12 general purpose timers: - five 16-bit and up to two 32-bit timers/counters - four oc modules configurable as timers/counters - ptg module with two configurable timers/counters - 32-bit quadrature encoder interface (qei) module configurable as a timer/counter ? four ic modules ? peripheral pin select (pps) to allow function remap ? peripheral trigger generator (ptg) for scheduling complex sequences communication interfaces ? two uart modules (17.5 mbps) - with support for lin 2.0 protocols and irda ? ? two 4-wire spi modules (15 mbps) ? ecan? module (1 mba ud) can 2.0b support ?two i 2 c? modules (up to 1 mbaud) with smbus support ? pps to allow function remap ? programmable cyclic redundancy check (crc) direct memory access (dma) ? 4-channel dma with user-selec table priority arbitration ? uart, spi, adc, ecan, ic, oc, and timers input/output ? sink/source 15 ma or 10 ma, pin-specific for standard voh/vol, up to 22 or 14 ma, respectively for non-standard voh1 ? 5v-tolerant pins ? selectable open drain, pull-ups, and pull-downs ? up to 5 ma overvoltage clamp current ? external interrupts on all i/o pins qualification and class b support ? aec-q100 revg (grade 1 -40oc to +125oc) planned ? aec-q100 revg (grade 0 -40oc to +150oc) planned ? class b safety library, iec 60730 debugger development support ? in-circuit and in-application programming ? two program and two complex data breakpoints ? ieee 1149.2-compatible (jtag) boundary scan ? trace and run-time watch packages type spdip soic ssop qfn-s qfn vtla tqfp pin count 28 28 28 28 44 64 36 44 44 64 i/o pins 21 21 21 21 35 53 25 35 35 53 contact lead/pitch .100'' 1.27 0.65 0.65 0.65 0.50 0.50 0.50 dimensions 1.365x.240x.120'' 17.9x7.50x2.05 10.50x7.80x2 6 x6x0.9 8x8x0.9 9x9x.9 5 x5x0.5 6x6x0.5 10x10x1 note: all dimensions are in millimeters (mm) unless specified. 16-bit microcontrollers and digital signal controllers (up to 256 kb flash and 32 kb sram) with high-speed pwm, op amps, and advanced analog
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 2 preliminary ? 2011 microchip technology inc. DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x product families the device names, pin counts, memory sizes, and peripheral availability of each device are listed in table 1 (general purpose families) and ta b l e 2 (motor control families). their pinout diagrams appear on the following pages. table 1: DSPIC33EPXXXGP50X and pic24epxxxgp20x general purpose families device page erase size (instructions) program flash memory (kbytes) ram (kbyte) remappable peripherals i 2 c? crc generator 10-bit/12-bit adc (channels) op amps/comparators ctmu ptg i/o pins pins packages 16-bit/32-bit timers input capture output compare uart spi (2) ecan? technology external interrupts (3) pic24ep32gp202 512 32 4 54422?32162/3 (1) yes yes 21 28 spdip, soic, ssop, qfn-s pic24ep64gp202 1024 64 8 pic24ep128gp202 1024 128 16 pic24ep256gp202 1024 256 32 pic24ep32gp203 512 32 4 54422?32183/4yesyes2536vtla pic24ep64gp203 1024 64 8 pic24ep32gp204 512 32 4 54422?32193/4yesyes3544 vtla, tqfp, qfn pic24ep64gp204 1024 64 8 pic24ep128gp204 1024 128 16 pic24ep256gp204 1024 256 32 pic24ep64gp206 1024 64 8 5 4 4 2 2 ? 3 2 1 16 3/4 yes yes 53 64 tqfp, qfn pic24ep128gp206 1024 128 16 pic24ep256gp206 1024 256 32 dspic33ep32gp502 512 32 4 54422132162/3 (1) yes yes 21 28 spdip, soic, ssop, qfn-s dspic33ep64gp502 1024 64 8 dspic33ep128gp502 1024 128 16 dspic33ep256gp502 1024 256 32 dspic33ep32gp503 512 32 4 54422132183/4yesyes2536vtla dspic33ep64gp503 1024 64 8 dspic33ep32gp504 512 32 4 54422132193/4yesyes3544 vtla, tqfp, qfn dspic33ep64gp504 1024 64 8 dspic33ep128gp504 1024 128 16 dspic33ep256gp504 1024 256 32 dspic33ep64gp506 1024 64 8 544221321163/4yesyes5364 tqfp, qfn dspic33ep128gp506 1024 128 16 dspic33ep256gp506 1024 256 32 note 1: on 28-pin devices, comparator 4 does not have external connections. refer to section 25.0 ?op amp/comparator module? for details. 2: only spi2 is remappable. 3: int0 is not remappable.
? 2011 microchip technology inc. preliminary ds70657d-page 3 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x table 2: dspic33epxxxmc20x/50x and pi c24epxxxmc20x motor control families device page erase size (instructions) program flash memory (kbytes) ram (kbytes) remappable peripherals i 2 c? crc generator 10-bit/12-bit adc (channels) op amps/comparators ctmu ptg i/o pins pins packages 16-bit/32-bit timers input capture output compare motor control pwm (4) (channels) quadrature encoder interface uart spi (2) ecan? technology external interrupts (3) pic24ep32mc202 512 32 4 544 6 1 2 2?3 2 1 62/3 (1) yes yes 21 28 spdip, soic, ssop, qfn-s pic24ep64mc202 1024 64 8 pic24ep128mc202 1024 128 16 pic24ep256mc202 1024 256 32 pic24ep32mc203 512 32 4 5 4 4 6 1 2 2 ? 3 2 1 8 3/4 yes yes 25 36 vtla pic24ep64mc203 1024 64 8 pic24ep32mc204 512 32 4 5 4 4 6 1 2 2 ? 3 2 1 9 3/4 yes yes 35 44 vtla, tqfp, qfn pic24ep64mc204 1024 64 8 pic24ep128mc204 1024 128 16 pic24ep256mc204 1024 256 32 pic24ep64mc206 1024 64 8 5 4 4 6 1 2 2 ? 3 2 1 16 3/4 yes yes 53 64 tqfp, qfn pic24ep128mc206 1024 128 16 pic24ep256mc206 1024 256 32 dspic33ep32mc202 512 32 4 544 6 1 2 2?3 2 1 62/3 (1) yes yes 21 28 spdip, soic, ssop, qfn-s dspic33ep64mc202 1024 64 8 dspic33ep128mc202 1024 128 16 dspic33ep256mc202 1024 256 32 dspic33ep32mc203 512 32 4 5 4 4 6 1 2 2 ? 3 2 1 8 3/4 yes yes 25 36 vtla dspic33ep64mc203 1024 64 8 dspic33ep32mc204 512 32 4 5 4 4 6 1 2 2 ? 3 2 1 9 3/4 yes yes 35 44 vtla, tqfp, qfn dspic33ep64mc204 1024 64 8 dspic33ep128mc204 1024 128 16 dspic33ep256mc204 1024 256 32 dspic33ep64mc206 1024 64 8 5 4 4 6 1 2 2 ? 3 2 1 16 3/4 yes yes 53 64 tqfp, qfn dspic33ep128mc206 1024 128 16 dspic33ep256mc206 1024 256 32 dspic33ep32mc502 512 32 4 544 6 122132162/3 (1) yes yes 21 28 spdip, soic, ssop, qfn-s dspic33ep64mc502 1024 64 8 dspic33ep128mc502 1024 128 16 dspic33ep256mc502 1024 256 32 dspic33ep32mc503 512 32 4 544 6 122132183/4yesyes2536 vtla dspic33ep64mc503 1024 64 8 dspic33ep32mc504 512 32 4 544 6 122132193/4yesyes3544 vtla, tqfp, qfn dspic33ep64mc504 1024 64 8 dspic33ep128mc504 1024 128 16 dspic33ep256mc504 1024 256 32 dspic33ep64mc506 1024 64 8 544 6 1221321163/4yesyes5364 tqfp, qfn dspic33ep128mc506 1024 128 16 dspic33ep256mc506 1024 256 32 note 1: on 28-pin devices, comparator 4 does no t have external connections. refer to section 25.0 ?op amp/comparator module? for details. 2: only spi2 is remappable. 3: int0 is not remappable. 4: only the pwm faults are remappable.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 4 preliminary ? 2011 microchip technology inc. pin diagrams 28-pin spdip/soic/ssop note 1: the rpn/rpin pins can be used by any remappable peripheral with some limitation. see section 11.4 ?peripheral pin select? for available peripherals and for information on limitations. 2: every i/o port pin (rax-rgx) can be used as change notification (cnax-cngx). see section 11.0 ?i/o ports? for more information. = pins are up to 5v tolerant 128 227 326 425 524 623 722 821 920 10 19 11 18 12 17 13 16 14 15 pic24epxxxgp202 dspic33epxxxgp502 mclr av dd an0/oa2out/ra0 av ss an1/c2in1+/ra1 rpi47/t5ck/rb15 pged3/v ref -/an2/c2in1-/ss1 /rpi32/cted2/rb0 rpi46/t3ck/rb14 pgec3/v ref +/an3/oa1out/rpi33/cted1/rb1 rpi45/ctpls/rb13 pgec1/an4/c1in1+/rpi34/rb2 rpi44/rb12 pged1/an5/c1in1-/rp35/rb3 tdi/rp43/rb11 tdo/rp42/rb10 osc1/clki/ra2 v cap osc2/clko/ra3 v ss rp36/rb4 tms/asda1 /sdi1/rp41/rb9 cv ref 2 o /rp20/t1ck/ra4 tck/cv ref 1 o /ascl1/sdo1/rp40/t4ck/rb8 v dd sck1/rp39/int0/rb7 pged2/asda2/rp37/rb5 pgec2/ascl2/rp38/rb6 v ss 128 227 326 425 524 623 722 821 920 10 19 11 18 12 17 13 16 14 15 pic24epxxxmc202 dspic33epxxxmc202/502 mclr av dd an0/oa2out/ra0 av ss an1/c2in1+/ra1 rpi47/pwm1l/t5ck/rb15 pged3/v ref -/an2/c2in1-/ss1 /rpi32/cted2/rb0 rpi46/pwm1h/t3ck/rb14 pgec3/v ref +/an3/oa1out/rpi33/cted1/rb1 rpi45/pwm2l/ctpls/rb13 pgec1/an4/c1in1+/rpi34/rb2 rpi44/pwm2h/rb12 pged1/an5/c1in1-/rp35/rb3 tdi/rp43/pwm3l/rb11 tdo/rp42/pwm3h/rb10 osc1/clki/ra2 v cap osc2/clko/ra3 v ss flt3 2 /rp36/rb4 tms/asda1/sdi1/rp41/rb9 cv ref 2 o /rp20/t1ck/ra4 tck/cv ref 1 o /ascl1/sdo1/rp40/t4ck/rb8 v dd sck1/rp39/int0/rb7 pged2/asda2/rp37/rb5 pgec2/ascl2/rp38/rb6 v ss
? 2011 microchip technology inc. preliminary ds70657d-page 5 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x pin diagrams (continued) 28-pin qfn-s (3) = pins are up to 5v tolerant 28 27 26 25 24 23 22 8 9 10 11 12 13 14 3 18 17 16 15 4 5 7 1 2 20 19 6 21 pic24epxxxgp202 dspic33epxxxgp502 tck/cv ref 1 o /ascl1/sdo1/rp40/t4ck/rb8 sck1/rp39/int0/rb7 pgec2/ascl2/rp38/rb6 pged2/asda2/rp37/rb5 v dd cv ref 2 o /rp20/t1ck/ra4 rp36/rb4 rpi45/ctpls/rb13 rpi44/rb12 tdi/rp43/rb11 tdo/rp42/rb10 v cap v ss tms/asda1/sdi1/rp41/rb9 rpi46/t3ck/rb14 rpi47/t5ck/rb15 av ss av dd mclr an0/oa2out/ra0 an1/c2in1+/ra1 pged3/v ref -/an2/c2in1-/ss1 /rpi32/cted2/rb0 pgec3/v ref +/an3/oa1out/rpi33/cted1/rb1 v ss osc1/clki/ra2 osc2/clko/ra3 pgec1/an4/c1in1+/rpi34/rb2 pged1/an5/c1in1-/rp35/rb3 note 1: the rpn/rpin pins can be used by any remapp able peripheral with some limitation. see section 11.4 ?peripheral pin select? for available peripherals and for information on limitations. 2: every i/o port pin (rax-rgx) can be us ed as change notification (cnax-cngx). see section 11.0 ?i/o ports? for more information. 3: the metal pad at the bottom of the device is not connected to any pins and is recommended to be connected to v ss externally.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 6 preliminary ? 2011 microchip technology inc. pin diagrams (continued) 28-pin qfn-s (3) = pins are up to 5v tolerant 28 27 26 25 24 23 22 8 9 10 11 12 13 14 3 18 17 16 15 4 5 7 1 2 20 19 6 21 pic24epxxxmc202 dspic33epxxxmc202/502 tck/cv ref 1 o /ascl1/sdo1/rp40/t4ck/rb8 sck1/rp39/int0/rb7 pgec2/ascl2/rp38/rb6 pged2/asda2/rp37/rb5 v dd cv ref 2 o /rp20/t1ck/ra4 flt3 2 /rp36/rb4 rpi45/pwm2l/ctpls/rb13 rpi44/pwm2h/rb12 tdi/rp43/pwm3l/rb11 tdo/rp42/pwm3h/rb10 v cap v ss tms/asda1/sdi1/rp41/rb9 rpi46/pwm1h/t3ck/rb14 rpi47/pwm1l/t5ck/rb15 av ss av dd mclr an0/oa2out/ra0 an1/c2in1+/ra1 pged3/v ref -/an2/c2in1-/ss1 /rpi32/cted2/rb0 pgec3/v ref +/an3/oa1out/rpi33/cted1/rb1 v ss osc1/clki/ra2 osc2/clko/ra3 pgec1/an4/c1in1+/rpi34/rb2 pged1/an5/c1in1-/rp35/rb3 note 1: the rpn/rpin pins can be used by any remapp able peripheral with some limitation. see section 11.4 ?peripheral pin select? for available peripherals and for information on limitations. 2: every i/o port pin (rax-rgx) can be us ed as change notification (cnax-cngx). see section 11.0 ?i/o ports? for more information. 3: the metal pad at the bottom of the device is not connected to any pins and is recommended to be connected to v ss externally.
? 2011 microchip technology inc. preliminary ds70657d-page 7 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x pin diagrams (continued) 36-pin vtla (3) 1 10 33 32 31 30 29 28 2 3 4 5 6 24 23 22 21 20 19 11 12 13 14 15 7 8 9 34 35 36 16 17 18 27 26 25 = pins are up to 5v tolerant pic24ep32gp203 tck/cv ref 1 o /ascl1/sdo1/rp40/t4ck/rb8 rpi45/ctpls/rb13 pgec1/an4/c1in1+/rpi34/rb2 pged1/an5/c1in1-/rp35/rb3 an6/oa3out/c4in1+/ocfb/rc0 an7/c3in1-/c4in1-/rc1 v dd v ss osc1/clki/ra2 osc2/clko/ra3 sda2/rpi24/ra8 rpi46/t3ck/rb14 rpi47/t5ck/rb15 av ss av dd mclr an0/oa2out/ra0 an1/c2in1+/ra1 pged3/v ref -/an2/c2in1-/ss1 /rpi32/cted2/rb0 pgec3/v ref +/an3/oa1out/rpi33/cted1/rb1 rpi44/rb12 tdi/rp43/rb11 tdo/rp42/rb10 v cap v ss rp56/rc8 tms/asda1/sdi1/rp41/rb9 sck1/rp39/int0/rb7 pgec2/ascl2/rp38/rb6 pged2/asda2/rp37/rb5 v dd v ss cv ref 2 o /rp20/t1ck/ra4 v dd scl2/rp36/rb4 v dd note 1: the rpn/rpin pins can be used by any rema ppable peripheral with some limitation. see section 11.4 ?peripheral pin select? for available peripherals and for information on limitations. 2: every i/o port pin (rax-rgx) can be used as change notification (cnax-cngx). see section 11.0 ?i/o ports? for more information. 3: the metal pad at the bottom of the device is not connected to any pins and is recommended to be connected to v ss externally. dspic33ep32gp503 pic24ep64gp203 dspic33ep64gp503
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 8 preliminary ? 2011 microchip technology inc. pin diagrams (continued) 36-pin vtla (3) = pins are up to 5v tolerant 1 10 33 32 31 30 29 28 2 3 4 5 6 24 23 22 21 20 19 11 12 13 14 15 7 8 9 34 35 36 16 17 18 27 26 25 pic24ep32mc203 tck/cv ref 1 o /ascl1/sdo1/rp40/t4ck/rb8 rpi45/pwm2l/ctpls/rb13 pgec1/an4/c1in1+/rpi34/rb2 pged1/an5/c1in1-/rp35/rb3 an6/oa3out/c4in1+/ocfb/rc0 an7/c3in1-/c4in1-/rc1 v dd v ss osc1/clki/ra2 osc2/clko/ra3 sda2/rpi24/ra8 rpi46/pwm1h/t3ck/rb14 rpi47/pwm1l/t5ck/rb15 av ss av dd mclr an0/oa2out/ra0 an1/c2in1+/ra1 pged3/v ref -/an2/c2in1-/ss1 /rpi32/cted2/rb0 pgec3/v ref +/an3/oa1out/rpi33/cted1/rb1 rpi44/pwm2h/rb12 tdi/rp43/pwm3l/rb11 tdo/rp42/pwm3h/rb10 v cap v ss rp56/rc8 tms/asda1/sdi1/rp41/rb9 sck1/rp39/int0/rb7 pgec2/ascl2/rp38/rb6 pged2/asda2/rp37/rb5 v dd v ss cv ref 2 o /rp20/t1ck/ra4 v dd flt32 /scl2/rp36/rb4 v dd note 1: the rpn/rpin pins can be used by any rema ppable peripheral with some limitation. see section 11.4 ?peripheral pin select? for available peripherals and for information on limitations. 2: every i/o port pin (rax-rgx) can be us ed as change notification (cnax-cngx). see section 11.0 ?i/o ports? for more information. 3: the metal pad at the bottom of the device is no t connected to any pins and is recommended to be connected to v ss externally. dspic33ep32mc203/503 pic24ep64mc203 dspic33ep64mc203/503
? 2011 microchip technology inc. preliminary ds70657d-page 9 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x pin diagrams (continued) 44-pin tqfp = pins are up to 5v tolerant 44 43 42 41 40 39 38 37 36 35 34 133 232 331 430 529 628 727 826 925 10 24 11 23 12 13 14 15 16 17 18 19 20 21 22 pic24epxxxgp204 tck/cv ref 1 o /ascl1/rp40/t4ck/rb8 tdo/ra10 rpi45/ctpls/rb13 pgec1/an4/c1in1+/rpi34/rb2 pged1/an5/c1in1-/rp35/rb3 an6/oa3out/c4in1+/ocfb/rc0 an7/c3in1-/c4in1-/rc1 an8/c3in1+/u1rts /bclk1/rc2 v dd v ss osc1/clki/ra2 osc2/clko/ra3 sda2/rpi24/ra8 scl2/rp36/rb4 tdi/ra7 rpi46/t3ck/rb14 rpi47/t5ck/rb15 av ss av dd mclr an0/oa2out/ra0 an1/c2in1+/ra1 pged3/v ref -/an2/c2in1-/ss1 /rpi32/cted2/rb0 pgec3/v ref +/an3/oa1out/rpi33/cted1/rb1 rpi44/rb12 rp43/rb11 rp42/rb10 v cap v ss rp57/rc9 rp56/rc8 rp55/rc7 rp54/rc6 tms/asda1/rp41/rb9 rp39/int0/rb7 pgec2/ascl2/rp38/rb6 pged2/asda2/rp37/rb5 v dd v ss scl1/rpi53/rc5 sda1/rpi52/rc4 sck1/rpi51/rc3 sdi1/rpi25/ra9 cv ref 2 o /sdo1/rp20/t1ck/ra4 note 1: the rpn/rpin pins can be used by any remapp able peripheral with some limitation. see section 11.4 ?peripheral pin select? for available peripherals and for information on limitations. 2: every i/o port pin (rax-rgx) can be us ed as change notification (cnax-cngx). see section 11.0 ?i/o ports? for more information. dspic33epxxxgp504
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 10 preliminary ? 2011 microchip technology inc. pin diagrams (continued) 44-pin tqfp = pins are up to 5v tolerant 44 43 42 41 40 39 38 37 36 35 34 133 232 331 430 529 628 727 826 925 10 24 11 23 12 13 14 15 16 17 18 19 20 21 22 pic24epxxxmc204 tck/cv ref 1 o /ascl1/rp40/t4ck/rb8 tdo/ra10 rpi45/pwm2l/ctpls/rb13 pgec1/an4/c1in1+/rpi34/rb2 pged1/an5/c1in1-/rp35/rb3 an6/oa3out/c4i n1+/ocfb/rc0 an7/c3in1-/c4in1-/rc1 an8/c3in1+/u1rts /bclk1/flt3 /rc2 v dd v ss osc1/clki/ra2 osc2/clko/ra3 sda2/rpi24/ra8 flt32 /scl2/rp36/rb4 tdi/ra7 rpi46/pwm1h/t3ck/rb14 rpi47/pwm1l/t5ck/rb15 av ss av dd mclr an0/oa2out/ra0 an1/c2in1+/ra1 pged3/v ref -/an2/c2in1-/ss1 /rpi32/cted2/rb0 pgec3/v ref +/an3/oa1out/rpi33/cted1/rb1 rpi44/pwm2h/rb12 rp43/pwm3l/rb11 rp42/pwm3h/rb10 v cap v ss rp57/rc9 rp56/rc8 rp55/rc7 rp54/rc6 tms/asda1/rp41/rb9 rp39/int0/rb7 pgec2/ascl2/rp38/rb6 pged2/asda2/rp37/rb5 v dd v ss scl1/rpi53/rc5 sda1/rpi52/rc4 sck1/rpi51/rc3 sdi1/rpi25/ra9 cv ref 2 o /sdo1/rp20/t1ck/ra4 note 1: the rpn/rpin pins can be used by any remapp able peripheral with some limitation. see section 11.4 ?peripheral pin select? for available peripherals and for information on limitations. 2: every i/o port pin (rax-rgx) can be us ed as change notification (cnax-cngx). see section 11.0 ?i/o ports? for more information. dspic33epxxxmc204/504
? 2011 microchip technology inc. preliminary ds70657d-page 11 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x pin diagrams (continued) 44-pin vtla (3) = pins are up to 5v tolerant pic24epxxxgp204 1 12 41 40 39 38 37 36 35 34 2 3 4 5 6 7 8 30 29 28 27 26 25 24 23 13 14 15 16 17 18 19 9 10 11 22 20 21 33 32 31 42 43 44 pgec1/an4/c1in1+/rpi34/rb2 pged1/an5/c1in1-/rp35/rb3 an6/oa3out/c4in1+/ocfb/rc0 an7/c3in1-/c4in1-/rc1 an8/c3in1+/u1rts /bclk1/rc2 v dd v ss osc1/clki/ra2 osc2/clko/ra3 sda2/rpi24/ra8 scl2/rp36/rb4 tck/cv ref 1 o /ascl1/rp40/t4ck/rb8 rp39/int0/rb7 pgec2/ascl2/rp38/rb6 pged2/asda2/rp37/rb5 v dd v ss scl1/rpi53/rc5 sda1/rpi52/rc4 sck1/rpi51/rc3 sdi1/rpi25/ra9 cv ref 2 o /sdo1/rp20/t1ck/ra4 rpi45/ctpls/rb13 rpi44/rb12 rp43/rb11 rp42/rb10 v cap v ss rp57/rc9 rp56/rc8 rp55/rc7 rp54/rc6 tms/asda1/rp41/rb9 tdo/ra10 tdi/ra7 rpi46/t3ck/rb14 rpi47/t5ck/rb15 av ss av dd mclr an0/oa2out/ra0 an1/c2in1+/ra1 pged3/v ref -/an2/c2in1-/ss1 /rpi32/cted2/rb0 pgec3/v ref +/an3/oa1out/rpi33/cted1/rb1 note 1: the rpn/rpin pins can be used by any remapp able peripheral with some limitation. see section 11.4 ?peripheral pin select? for available peripherals and for information on limitations. 2: every i/o port pin (rax-rgx) can be us ed as change notification (cnax-cngx). see section 11.0 ?i/o ports? for more information. 3: the metal pad at the bottom of the device is not connected to any pins and is recommended to be connected to v ss externally. dspic33epxxxgp504
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 12 preliminary ? 2011 microchip technology inc. pin diagrams (continued) 44-pin vtla (3) = pins are up to 5v tolerant pic24epxxxmc204 1 12 41 40 39 38 37 36 35 34 2 3 4 5 6 7 8 30 29 28 27 26 25 24 23 13 14 15 16 17 18 19 9 10 11 22 20 21 33 32 31 42 43 44 pgec1/an4/c1in1+/rpi34/rb2 pged1/an5/c1in1-/rp35/rb3 an6/oa3out/c4in1+/ocfb/rc0 an7/c3in1-/c4in1-/rc1 an8/c3in1+/u1rts /bclk1/flt3 /rc2 v dd v ss osc1/clki/ra2 osc2/clko/ra3 sda2/rpi24/ra8 flt32 /scl2/rp36/rb4 tck/cv ref 1 o /ascl1/rp40/t4ck/rb8 rp39/int0/rb7 pgec2/ascl2/rp38/rb6 pged2/asda2/rp37/rb5 v dd v ss scl1/rpi53/rc5 sda1/rpi52/rc4 sck1/rpi51/rc3 sdi1/rpi25/ra9 cv ref 2 o /sdo1/rp20/t1ck/ra4 rpi45/pwm2l/ctpls/rb13 rpi44/pwm2h/rb12 rp43/pwm3l/rb11 rp42/pwm3h/rb10 v cap v ss rp57/rc9 rp56/rc8 rp55/rc7 rp54/rc6 tms/asda1/rp41/rb9 tdo/ra10 tdi/ra7 rpi46/pwm1h/t3ck/rb14 rpi47/pwm1l/t5ck/rb15 av ss av dd mclr an0/oa2out/ra0 an1/c2in1+/ra1 pged3/v ref -/an2/c2in1-/ss1 /rpi32/cted2/rb0 pgec3/v ref +/an3/oa1out/rpi33/cted1/rb1 note 1: the rpn/rpin pins can be used by any remapp able peripheral with some limitation. see section 11.4 ?peripheral pin select? for available peripherals and for information on limitations. 2: every i/o port pin (rax-rgx) can be us ed as change notification (cnax-cngx). see section 11.0 ?i/o ports? for more information. 3: the metal pad at the bottom of the device is not connected to any pins and is recommended to be connected to v ss externally. dspic33epxxxmc204/504
? 2011 microchip technology inc. preliminary ds70657d-page 13 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x pin diagrams (continued) 44-pin qfn (3) = pins are up to 5v tolerant 44 43 42 41 40 39 38 37 36 35 12 13 14 15 16 17 18 19 20 21 3 30 29 28 27 26 25 24 23 4 5 7 8 9 10 11 1 2 32 31 6 22 33 34 pic24epxxxgp204 pgec1/an4/c1in1+/rpi34/rb2 pged1/an5/c1in1-/rp35/rb3 an6/oa3out/c4in1+/ocfb/rc0 an7/c3in1-/c4in1-/rc1 an8/c3in1+/u1rts /bclk1/rc2 v dd v ss osc1/clki/ra2 osc2/clko/ra3 sda2/rpi24/ra8 scl2/rp36/rb4 tck/cv ref 1 o /ascl1/rp40/t4ck/rb8 rp39/int0/rb7 pgec2/ascl2/rp38/rb6 pged2/asda2/rp37/rb5 v dd v ss scl1/rpi53/rc5 sda1/rpi52/rc4 sck1/rpi51/rc3 sdi1/rpi25/ra9 cv ref 2 o /sdo1/rp20/t1ck/ra4 rpi45/ctpls/rb13 rpi44/rb12 rp43/rb11 rp42/rb10 v cap v ss rp57/rc9 rp56/rc8 rp55/rc7 rp54/rc6 tms/asda1/rp41/rb9 tdo/ra10 tdi/ra7 rpi46/t3ck/rb14 rpi47/t5ck/rb15 av ss av dd mclr an0/oa2out/ra0 an1/c2in1+/ra1 pged3/v ref -/an2/c2in1-/ss1 /rpi32/cted2/rb0 pgec3/v ref +/an3/oa1out/rpi33/cted1/rb1 note 1: the rpn/rpin pins can be used by any remapp able peripheral with some limitation. see section 11.4 ?peripheral pin select? for available peripherals and for information on limitations. 2: every i/o port pin (rax-rgx) can be us ed as change notification (cnax-cngx). see section 11.0 ?i/o ports? for more information. 3: the metal pad at the bottom of the device is not connected to any pins and is recommended to be connected to v ss externally. dspic33epxxxgp504
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 14 preliminary ? 2011 microchip technology inc. pin diagrams (continued) 44-pin qfn (3) = pins are up to 5v tolerant 44 43 42 41 40 39 38 37 36 35 12 13 14 15 16 17 18 19 20 21 3 30 29 28 27 26 25 24 23 4 5 7 8 9 10 11 1 2 32 31 6 22 33 34 pic24epxxxmc204 pgec1/an4/c1in1+/rpi34/rb2 pged1/an5/c1in1-/rp35/rb3 an6/oa3out/c4in1+/ocfb/rc0 an7/c3in1-/c4in1-/rc1 an8/c3in1+/u1rts /bclk1/flt3 /rc2 v dd v ss osc1/clki/ra2 osc2/clko/ra3 sda2/rpi24/ra8 flt32 /scl2/rp36/rb4 tck/cv ref 1 o /ascl1/rp40/t4ck/rb8 rp39/int0/rb7 pgec2/ascl2/rp38/rb6 pged2/asda2/rp37/rb5 v dd v ss scl1/rpi53/rc5 sda1/rpi52/rc4 sck1/rpi51/rc3 sdi1/rpi25/ra9 cv ref 2 o /sdo1/rp20/t1ck/ra4 rpi45/pwm2l/ctpls/rb13 rpi44/pwm2h/rb12 rp43/pwm3l/rb11 rp42/pwm3h/rb10 v cap v ss rp57/rc9 rp56/rc8 rp55/rc7 rp54/rc6 tms/asda1/rp41/rb9 tdo/ra10 tdi/ra7 rpi46/pwm1h/t3ck/rb14 rpi47/pwm1l/t5ck/rb15 av ss av dd mclr an0/oa2out/ra0 an1/c2in1+/ra1 pged3/v ref -/an2/c2in1-/ss1 /rpi32/cted2/rb0 pgec3/v ref +/an3/oa1out/rpi33/cted1/rb1 note 1: the rpn/rpin pins can be used by any remapp able peripheral with some limitation. see section 11.4 ?peripheral pin select? for available peripherals and for information on limitations. 2: every i/o port pin (rax-rgx) can be us ed as change notification (cnax-cngx). see section 11.0 ?i/o ports? for more information. 3: the metal pad at the bottom of the device is not connected to any pins and is recommended to be connected to v ss externally. dspic33epxxxmc204/504
? 2011 microchip technology inc. preliminary ds70657d-page 15 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x pin diagrams (continued) 64-pin tqfp = pins are up to 5v tolerant 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 148 247 346 445 544 643 742 841 940 10 39 11 38 12 37 13 36 14 35 15 34 16 33 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 tdi/ra7 rpi46/t3ck/rb14 rpi47/t5ck/rb15 rp118/rg6 rpi119/rg7 rp120/rg8 mclr rpi121/rg9 v ss v dd an10/rpi28/ra12 an9/rpi27/ra11 an0/oa2out/ra0 an1/c2in1+/ra1 pged3/v ref -/an2/c2in1-/ss1 /rpi32/cted2/rb0 pgec3/v ref +/an3/oa1out/rpi33/cted1/rb1 tdo/ra10 rpi45/ctpls/rb13 rpi44/rb12 rp43/rb11 rp42/rb10 rp97/rf1 rpi96/rf0 v dd v cap rp57/rc9 rd6 rd5 rp56/rc8 rp55/rc7 rp54/rc6 tms/asda1/rp41/rb9 tck/cv ref 1 o /ascl1/rp40/t4ck/rb8 rc13 rp39/int0/rb7 rpi58/rc10 pgec2/ascl2/rp38/rb6 pged2/asda2/rp37/rb5 rd8 v ss osc2/clko/rc15 osc1/clki/rc12 v dd scl1/rpi53/rc5 sda1/rpi52/rc4 sck1/rpi51/rc3 sdi1/rpi25/ra9 cv ref 2 o /sdo1/rp20/t1ck/ra4 pgec1/an4/c1in1+/rpi34/rb2 pged1/an5/c1in1-/rp35/rb3 av dd av ss an6/oa3out/c4in1+/ocfb/rc0 an7/c3in1-/c4in1-/rc1 an8/c3in1+/u1rts /bclk1/rc2 an11/c1in2- (3) /u1cts /rc11 v ss v dd an12/c2in2- (3) /u2rts /bclk2/re12 an13/c3in2- (3) /u2cts /re13 an14/rpi94/re14 an15/rpi95/re15 sda2/rpi24/ra8 scl2/rp36/rb4 note 1: the rpn/rpin pins can be used by any rema ppable peripheral with some limitation. see section 11.4 ?peripheral pin select? for available peripherals and for information on limitations. 2: every i/o port pin (rax-rgx) can be used as change notification (cnax-cngx). see section 11.0 ?i/ o ports? for more information. 3: this pin is not available as an input when opmode (cmxcon<10>) = 1 . dspic33ep64gp506 pic24ep64gp206 pic24ep128gp206 pic24ep256gp206 dspic33ep128gp506 dspic33ep256gp506
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 16 preliminary ? 2011 microchip technology inc. pin diagrams (continued) 64-pin tqfp = pins are up to 5v tolerant 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 148 247 346 445 544 643 742 841 940 10 39 11 38 12 37 13 36 14 35 15 34 16 33 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 tdi/ra7 rpi46/pwm1h/t3ck/rb14 rpi47/pwm1l/t5ck/rb15 rp118/rg6 rpi119/rg7 rp120/rg8 mclr rpi121/rg9 v ss v dd an10/rpi28/ra12 an9/rpi27/ra11 an0/oa2out/ra0 an1/c2in1+/ra1 pged3/ v ref -/an2/c2in1-/ss1 /rpi32/cted2/rb0 pgec3/ v ref +/an3/oa1out/rpi33/cted1/rb1 tdo/ra10 rpi45/pwm2l/ctpls/rb13 rpi44/pwm2h/rb12 rp43/pwm3l/rb11 rp42/pwm3h/rb10 rp97/rf1 rpi96/rf0 v dd v cap rp57/rc9 rd6 rd5 rp56/rc8 rp55/rc7 rp54/rc6 tms/asda1/rp41/rb9 tck/ cv ref 1 o /ascl1/rp40/t4ck/rb8 rc13 rp39/int0/rb7 rpi58/rc10 pgec2/ascl2/rp38/rb6 pged2/asda2/rp37/rb5 rd8 v ss osc2/clko/rc15 osc1/clki/rc12 v dd scl1/rpi53/rc5 sda1/rpi52/rc4 sck1/rpi51/rc3 sdi1/rpi25/ra9 cv ref 2 o /sdo1/rp20/t1ck/ra4 pgec1/an4/c1in1+/rpi34/rb2 pged1/an5/c1in1-/rp35/rb3 av dd av ss an6/oa3out/c4in1+/ocfb/rc0 an7/c3in1-/c4in1-/rc1 an8/c3in1+/u1rts / bclk1/ flt3 /rc2 an11/c1in2- (3) /u1cts /flt4 /rc11 v ss v dd an12/c2in2- (3) /u2rts / bclk2/ re12 an13/c3in2- (3) /u2cts /re13 an14/rpi94/re14 an15/rpi95/re15 sda2/rpi24/ra8 flt32 /scl2/rp36/rb4 note 1: the rpn/rpin pins can be used by any rema ppable peripheral with some limitation. see section 11.4 ?peripheral pin select? for available peripherals and for information on limitations. 2: every i/o port pin (rax-rgx) can be used as change notification (cnax-cngx). see section 11.0 ?i/ o ports? for more information. 3: this pin is not available as an input when opmode (cmxcon<10>) = 1 . pic24ep64mc206 dspic33ep64mc206/506 pic24ep128mc206 pic24ep256mc206 dspic33ep128mc206/506 dspic33ep256mc206/506
? 2011 microchip technology inc. preliminary ds70657d-page 17 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x pin diagrams (continued) 64-pin qfn (4) = pins are up to 5v tolerant tdo/ra10 rpi45/ctpls/rb13 rpi44/rb12 rp43/rb11 rp42/rb10 rp97/rf1 rpi96/rf0 v dd v cap rp57/rc9 rd6 rd5 rp56/rc8 rp55/rc7 rp54/rc6 tms/asda1/rp41/rb9 tck/ cv ref 1 o /ascl1/rp40/t4ck/rb8 rc13 rp39/int0/rb7 rpi58/rc10 pgec2/ascl2/rp38/rb6 pged2/asda2/rp37/rb5 rd8 v ss osc2/clko/rc15 osc1/clki/rc12 v dd scl1/rpi53/rc5 sda1/rpi52/rc4 sck1/rpi51/rc3 sdi1/rpi25/ra9 cv ref 2 o /sdo1/rp20/t1ck/ra4 pgec1/an4/c1in1+/rpi34/rb2 pged1/an5/c1in1-/rp35/rb3 av dd av ss an6/oa3out/c4in1+/ocfb/rc0 an7/c3in1-/c4in1-/rc1 an8/c3in1+/u1rts / bclk1/ rc2 an11/c1in2- (3) /u1cts /rc11 v ss v dd an12/c2in2- (3) /u2rts / bclk2/ re12 an13/c3in2- (3) /u2cts /re13 an14/rpi94/re14 an15/rpi95/re15 sda2/rpi24/ra8 scl2/rp36/rb4 tdi/ra7 rpi46/t3ck/rb14 rpi47/t5ck/rb15 rp118/rg6 rpi119/rg7 rp120/rg8 mclr rpi121/rg9 v ss v dd an10/rpi28/ra12 an9/rpi27/ra11 an0/oa2out/ra0 an1/c2in1+/ra1 pged3/ v ref -/an2/c2in1-/ss1 /rpi32/cted2/rb0 pgec3/ v ref +/an3/oa1out/rpi33/cted1/rb1 pic24ep64gp206 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 148 247 346 445 544 643 742 841 940 10 39 11 38 12 37 13 36 14 35 15 34 16 33 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 note 1: the rpn/rpin pins can be used by any rema ppable peripheral with some limitation. see section 11.4 ?peripheral pin select? for available peripherals and for information on limitations. 2: every i/o port pin (rax-rgx) can be used as change notification (cnax-cngx). see section 11.0 ?i/ o ports? for more information. 3: this pin is not available as an input when opmode (cmxcon<10>) = 1 . 4: the metal pad at the bottom of the device is no t connected to any pins and is recommended to be connected to v ss externally. dspic33ep64gp506 pic24ep128gp206 pic24ep256gp206 dspic33ep128gp506 dspic33ep256gp506
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 18 preliminary ? 2011 microchip technology inc. pin diagrams (continued) 64-pin qfn (4) = pins are up to 5v tolerant 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 148 247 346 445 544 643 742 841 940 10 39 11 38 12 37 13 36 14 35 15 34 16 33 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 tdo/ra10 rpi45/pwm2l/ctpls/rb13 rpi44/pwm2h/rb12 rp43/pwm3l/rb11 rp42/pwm3h/rb10 rp97/rf1 rpi96/rf0 v dd v cap rp57/rc9 rd6 rd5 rp56/rc8 rp55/rc7 rp54/rc6 tms/asda1/rp41/rb9 tck/ cv ref 1 o /ascl1/rp40/t4ck/rb8 rc13 rp39/int0/rb7 rpi58/rc10 pgec2/ascl2/rp38/rb6 pged2/asda2/rp37/rb5 rd8 v ss osc2/clko/rc15 osc1/clki/rc12 v dd scl1/rpi53/rc5 sda1/rpi52/rc4 sck1/rpi51/rc3 sdi1/rpi25/ra9 cv ref 2 o /sdo1/rp20/t1ck/ra4 pgec1/an4/c1in1+/rpi34/rb2 pged1/an5/c1in1-/rp35/rb3 av dd av ss an6/oa3out/c4in1+/ocfb/rc0 an7/c3in1-/c4in1-/rc1 an8/c3in1+/u1rts / bclk1/ flt3 /rc2 an11/c1in2- (3) /u1cts /flt4 /rc11 v ss v dd an12/c2in2- (3) /u2rts / bclk2/ re12 an13/c3in2- (3) /u2cts /re13 an14/rpi94/re14 an15/rpi95/re15 sda2/rpi24/ra8 flt32 /scl2/rp36/rb4 tdi/ra7 rpi46/pwm1h/t3ck/rb14 rpi47/pwm1l/t5ck/rb15 rp118/rg6 rpi119/rg7 rp120/rg8 mclr rpi121/rg9 v ss v dd an10/rpi28/ra12 an9/rpi27/ra11 an0/oa2out/ra0 an1/c2in1+/ra1 pged3/ v ref -/an2/c2in1-/ss1 /rpi32/cted2/rb0 pgec3/ v ref +/an3/oa1out/rpi33/cted1/rb1 note 1: the rpn/rpin pins can be used by any rem appable peripheral with some limitation. see section 11.4 ?peripheral pin select? for available peripherals and for information on limitations. 2: every i/o port pin (rax-rgx) can be used as change notificat ion (cnax-cngx). see section 11.0 ?i/o ports? for more information. 3: this pin is not available as an input when opmode (cmxcon<10>) = 1 . 4: the metal pad at the bottom of the device is not connected to any pins and is recommended to be connected to v ss externally. pic24ep64mc206 dspic33ep64mc206/506 pic24ep128mc206 pic24ep256mc206 dspic33ep128mc206/506 dspic33ep256mc206/506
? 2011 microchip technology inc. preliminary ds70657d-page 19 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x table of contents 1.0 device overview ............................................................................................................. ........................................................... 21 2.0 guidelines for getting started with 16-bit di gital signal controller s and microcontrollers.................................. ....................... 25 3.0 cpu......................................................................................................................... ................................................................... 31 4.0 memory organization ......................................................................................................... ........................................................ 41 5.0 flash program memory........................................................................................................ .................................................... 111 6.0 resets ..................................................................................................................... ................................................................ 115 7.0 interrupt controller ........................................................................................................ ........................................................... 119 8.0 direct memory access (dma) .................................................................................................. ................................................ 131 9.0 oscillator configuration .................................................................................................... ........................................................ 145 10.0 power-saving features...................................................................................................... ...................................................... 155 11.0 i/o ports .................................................................................................................. ................................................................. 165 12.0 timer1 ..................................................................................................................... ................................................................. 195 13.0 timer2/3 and timer4/5 ..................................................................................................... ....................................................... 199 14.0 input capture.............................................................................................................. .............................................................. 205 15.0 output compare............................................................................................................. .......................................................... 211 16.0 high-speed pwm module (dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only) ....................................... 217 17.0 quadrature encoder interface (qei) module (dspic 33epxxxmc20x/50x and pic24epxxxmc20x devices only)........... 241 18.0 serial peripheral interface (spi).......................................................................................... ..................................................... 257 19.0 inter-integrated circuit? (i 2 c?)............................................................................................................................ .................. 265 20.0 universal asynchronous receiv er transmitter (uart) ......................................................................... .................................. 273 21.0 enhanced can (ecan?) module (dspic33epxxxgp/mc50x devices only) ............................................................ ......... 279 22.0 charge time measurement unit (ctmu) ....................................................................................... ........................................ 305 23.0 10-bit/12-bit analog-to-digital converter (adc) ............................................................................ ........................................... 311 24.0 peripheral trigger generat or (ptg) module.................................................................................. .......................................... 327 25.0 op amp/comparator module................................................................................................... ................................................. 345 26.0 programmable cyclic redundanc y check (crc) generator ....................................................................... ........................... 363 27.0 special features ........................................................................................................... ........................................................... 369 28.0 instruction set summary .................................................................................................... ...................................................... 379 29.0 development support........................................................................................................ ....................................................... 389 30.0 electrical characteristics ................................................................................................. ......................................................... 393 31.0 dc and ac device characteristics graphs.................................................................................... .......................................... 459 32.0 packaging information...................................................................................................... ........................................................ 463 appendix a: revision history................................................................................................... .......................................................... 487 index .......................................................................................................................... ....................................................................... 493 to our valued customers it is our intention to provide our valued customers with the best documentation possible to ensure successful use of your micro chip products. to this end, we will continue to improve our publicat ions to better suit your needs. our publications will be refined and enhanced as new volumes and updates are introduced. if you have any questions or comments r egarding this publication, please contact the marketing communications department via e-mail at docerrors@microchip.com or fax the reader response form in the back of this data sheet to (480) 792-4150. we welcome your feedback. most current data sheet to obtain the most up-to-date version of this data s heet, please register at our worldwide web site at: http://www.microchip.com you can determine the version of a data sheet by examining its literature number found on the bottom outside corner of any page . the last character of the literature number is the vers ion number, (e.g., ds30000a is version a of document ds30000). errata an errata sheet, describing minor operational differences from the data sheet and recommended workarounds, may exist for curren t devices. as device/documen tation issues become known to us, we will publish an errata sheet. the errata will specify the revisi on of silicon and revision of document to which it applies. to determine if an errata sheet exists for a partic ular device, please check with one of the following: ? microchip?s worldwide web site; http://www.microchip.com ? your local microchip sales office (see last page) when contacting a sales office, please spec ify which device, revision of silicon and dat a sheet (include literature number) you are using. customer notification system register on our web site at www.microchip.com to receive the most current information on all of our products.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 20 preliminary ? 2011 microchip technology inc. referenced sources this device data sheet is based on the following individual chapters of the ?dspic33e/pic24e family reference manual? . these documents should be considered as the general re ference for the operation of a particular module or device feature. ? section 1. ?introduction? (ds70573) ? section 2. ?cpu? (ds70359) ? section 3. ?data memory? (ds70595) ? section 4. ?program memory? (ds70613) ? section 5. ?flash programming? (ds70609) ? section 6. ?interrupts? (ds70600) ? section 7. ?oscillator? (ds70580) ? section 8. ?reset? (ds70602) ? section 9. ?watchdog timer and power-saving modes? (ds70615) ? section 10. ?i/o ports? (ds70598) ? section 11. ?timers? (ds70362) ? section 12. ?input capture? (ds70352) ? section 13. ?output compare? (ds70358) ? section 14. ?high-speed pwm? (ds70645) ? section 15. ?quadrature encoder interface (qei)? (ds70601) ? section 16. ?analog-to-digital converter (adc)? (ds70621) ? section 17. ?uart? (ds70582) ? section 18. ?serial peri pheral interface (spi)? (ds70569) ? section 19. ?inter-integrated circuit (i 2 c?)? (ds70330) ? section 21. ?enhanced contro ller area network (ecan?)? (ds70353) ? section 22. ?direct memory access (dma)? (ds70348) ? section 23. ?codeguard? security? (ds70634) ? section 24. ?programming and diagnostics? (ds70608) ? section 26. ?op amp/comparator? (ds70357) ? section 27. ?programmable cyclic redundancy check (crc)? (ds70346) ? section 30. ?device configuration? (ds70618) ? section 32. ?peripheral trigger generator (ptg)? (ds70669) ? section 33. ?charge time measurement unit (ctmu)? (ds70661) note 1: to access the documents listed below, browse to the documentation section of the dspic33ep64mc506 product page of the microchip web site ( www.microchip.com ) or select a family reference manual section from the following list. in addition to parameters, features, and other documentation, the resulting page provides links to the related family reference manual sections.
? 2011 microchip technology inc. preliminary ds70657d-page 21 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 1.0 device overview this document contains device-specific information for the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/ 50x, and pic24epxxxgp/ mc20x digital signal controller (dsc) and microc ontroller (mcu) devices. the dspic33epxxxmc20x/50x and DSPIC33EPXXXGP50X devices c ontain extensive digital signal processor (dsp) functionality with a high-perfor- mance 16-bit mcu architecture. figure 1-1 shows a general block diagram of the core and peripheral modules. ta b l e 1 - 1 lists the functions of the various pins shown in the pinout diagrams. figure 1-1: DSPIC33EPXXXGP50X, dspic 33epxxxmc20x/50x, and pic24epxxxgp/mc20x block diagram note 1: this data sheet summarizes the fea- tures of the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x families of devices. it is not intended to be a com- prehensive resource. to complement the information in this data sheet, refer to the related section of the ? dspic33e/ pic24e family reference manual? , which is available from the microchip web site ( www.microchip.com ) 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for de vice-specific register and bit information. porta power-up timer oscillator start-up timer osc1/clki mclr v dd , v ss uart1, timing generation ecan1 (2) i2c1, adc timers input capture output compare av dd , av ss uart2 spi2 spi1, watchdog timer por/bor crc i2c2 qei1 (1) pwm (1) remappable pins note 1: this feature or peripheral is only available on dspic33epxxxmc20x/50x and pic24epxxxmc20x devices. 2: this feature or peripheral is only av ailable on dspic33epxxxgp/mc50x devices. op amp/ comparator ctmu ptg cpu refer to figure 3-1 for cpu diagram details. 16 16 porta portc portd porte portf portg ports peripheral modules
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 22 preliminary ? 2011 microchip technology inc. table 1-1: pinout i/o descriptions pin name (4) pin type buffer type pps description an0-an15 i analog no analog input channels. clki clko i o st/ cmos ? no no external clock source input. always associated with osc1 pin function. oscillator crystal output. connects to crystal or resonator in crystal oscillator mode. optionally functions as clko in rc and ec modes. always associated with osc2 pin function. osc1 osc2 i i/o st/ cmos ? no no oscillator crystal input. st buffer w hen configured in rc mode; cmos otherwise. oscillator crystal output. connects to crystal or resonator in crystal oscillator mode. optionally functions as clko in rc and ec modes. refclko o ? yes reference clock output. ic1-ic4 i st yes capture inputs 1 through 4. ocfa ocfb oc1-oc4 i i o st st ? yes no yes compare fault a input (for compare channels). compare fault b input (for compare channels). compare outputs 1 through 4. int0 int1 int2 i i i st st st no yes yes external interrupt 0. external interrupt 1. external interrupt 2. ra0-ra4, ra7-ra12 i/o st no porta is a bidirectional i/o port. rb0-rb15 i/o st no portb is a bidirectional i/o port. rc0-rc13, rc15 i/o st no portc is a bidirectional i/o port. rd5, rd6, rd8 i/o st no portd is a bidirectional i/o port. re12-re15 i/o st no porte is a bidirectional i/o port. rf0, rf1 i/o st no portf is a bidirectional i/o port. rg6-rg9 i/o st no portg is a bidirectional i/o port. t1ck t2ck t3ck t4ck t5ck i i i i i st st st st st no yes no no no timer1 external clock input. timer2 external clock input. timer3 external clock input. timer4 external clock input. timer5 external clock input. ctpls cted1 cted2 o i i st st st no no no ctmu pulse output. ctmu external edge input 1. ctmu external edge input 2. u1cts u1rts u1rx u1tx bclk1 i o i o o st ? st ? st no no yes yes no uart1 clear to send. uart1 ready to send. uart1 receive. uart1 transmit. uart1 irda baud clock output. legend: cmos = cmos compatible input or output analog = analog input p = power st = schmitt trigger input with cmos levels o = output i = input pps = peripheral pin sele ct ttl = ttl input buffer note 1: this pin is available on dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only. 2: this pin is available on dspi c33epxxxgp/mc50x devices only. 3: this is the default fault on reset for dspic3 3epxxxmc20x/50x and pic24epxxxmc20x devices. see section 16.0 ?high-speed pwm module (d spic33epxxxmc20x/50x and pic24epxxxmc20x devices only)? for more information. 4: not all pins are available in all packages variants. see the ?pin diagrams? section for pin availability.
? 2011 microchip technology inc. preliminary ds70657d-page 23 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x u2cts u2rts u2rx u2tx bclk2 i o i o o st ? st ? st no no yes yes no uart2 clear to send. uart2 ready to send. uart2 receive. uart2 transmit. uart2 irda baud clock output. sck1 sdi1 sdo1 ss1 i/o i o i/o st st ? st no no no no synchronous serial clock input/output for spi1. spi1 data in. spi1 data out. spi1 slave synchronization or frame pulse i/o. sck2 sdi2 sdo2 ss2 i/o i o i/o st st ? st yes yes yes yes synchronous serial clock input/output for spi2. spi2 data in. spi2 data out. spi2 slave synchronization or frame pulse i/o. scl1 sda1 ascl1 asda1 i/o i/o i/o i/o st st st st no no no no synchronous serial clock input/output for i2c1. synchronous serial data input/output for i2c1. alternate synchronous serial clock input/output for i2c1. alternate synchronous serial data input/output for i2c1. scl2 sda2 ascl2 asda2 i/o i/o i/o i/o st st st st no no no no synchronous serial clock input/output for i2c2. synchronous serial data input/output for i2c2. alternate synchronous serial clock input/output for i2c2. alternate synchronous serial data input/output for i2c2. tms tck tdi tdo i i i o st st st ? no no no no jtag test mode select pin. jtag test clock input pin. jtag test data input pin. jtag test data output pin. c1rx (2) c1tx (2) i o st ? yes yes ecan1 bus receive pin. ecan1 bus transmit pin. flt1 (1) , flt2 (1) flt3 (1) , flt4 (1) flt32 (1,3) dtcmp1-dtcmp3 (1) pwm1l-pwm3l (1) pwm1h-pwm3h (1) synci1 (1) synco1 (1) i i i i o o i o st st st st ? ? st ? yes no no yes no no yes yes pwm fault input 1 and 2. pwm fault input 3 and 4. pwm fault input 32 (class b fault). pwm dead time compensation input 1 through 3. pwm low output 1 through 3. pwm high output 1 through 3. pwm synchronization input 1. pwm synchronization output 1. indx1 (1) home1 (1) qea1 (1) qeb1 (1) cntcmp1 (1) i i i i o st st st st ? yes yes yes yes yes quadrature encoder index1 pulse input. quadrature encoder home1 pulse input. quadrature encoder phase a input in qei1 mode. auxiliary timer external clock/gate input in timer mode. quadrature encoder phase b input in qei1 mode. auxiliary timer external clock/gate input in timer mode. quadrature encoder compare output 1. table 1-1: pinout i/o descriptions (continued) pin name (4) pin type buffer type pps description legend: cmos = cmos compatible input or output analog = analog input p = power st = schmitt trigger input with cmos levels o = output i = input pps = peripheral pin select ttl = ttl input buffer note 1: this pin is available on dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only. 2: this pin is available on dspi c33epxxxgp/mc50x devices only. 3: this is the default fault on reset for dspic3 3epxxxmc20x/50x and pic24epxxxmc20x devices. see section 16.0 ?high-speed pwm module (d spic33epxxxmc20x/50x and pic24epxxxmc20x devices only)? for more information. 4: not all pins are available in all packages variants. see the ?pin diagrams? section for pin availability.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 24 preliminary ? 2011 microchip technology inc. c1in1- c1in2- c1in1+ oa1out c1out i i i o o analog analog analog analog ? no no no no yes op amp/comparator 1 negative input 1. comparator 1 negative input 2. op amp/comparator 1 positive input 1. op amp 1 output. comparator 1 output. c2in1- c2in2- c2in1+ oa2out c2out i i i o o analog analog analog analog ? no no no no yes op amp/comparator 2 negative input 1. comparator 2 negative input 2. op amp/comparator 2 positive input 1. op amp 2 output. comparator 2 output. c3in1- c3in2- c3in1+ oa3out c3out i i i o o analog analog analog analog ? no no no no yes op amp/comparator 3 negative input 1. comparator 3 negative input 2. op amp/comparator 3 positive input 1. op amp 3 output. comparator 3 output. c4in1- c4in1+ c4out i i o analog analog ? no no yes comparator 4 negative input 1. comparator 4 positive input 1. comparator 4 output. cv ref 1 o c vref 2 o o o analog analog no no op amp/comparator voltage reference output. op amp/comparator voltage reference divided by 2 output. pged1 pgec1 pged2 pgec2 pged3 pgec3 i/o i i/o i i/o i st st st st st st no no no no no no data i/o pin for programming/debugging communication channel 1. clock input pin for programming/debugging communication channel 1. data i/o pin for programming/debugging communication channel 2. clock input pin for programming/debugging communication channel 2. data i/o pin for programming/debugging communication channel 3. clock input pin for programming/debugging communication channel 3. mclr i/p st no master clear (reset) input. this pin is an active-low reset to the device. av dd p p no positive supply for analog modules. this pin must be connected at all times. av ss p p no ground reference for analog modules. this pin must be connected at all times. v dd p ? no positive supply for peripheral logic and i/o pins. v cap p ? no cpu logic filter capacitor connection. v ss p ? no ground reference for logic and i/o pins. v ref + i analog no analog voltage reference (high) input. v ref - i analog no analog voltage reference (low) input. table 1-1: pinout i/o descriptions (continued) pin name (4) pin type buffer type pps description legend: cmos = cmos compatible input or output analog = analog input p = power st = schmitt trigger input with cmos levels o = output i = input pps = peripheral pin sele ct ttl = ttl input buffer note 1: this pin is available on dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only. 2: this pin is available on dspi c33epxxxgp/mc50x devices only. 3: this is the default fault on reset for dspic3 3epxxxmc20x/50x and pic24epxxxmc20x devices. see section 16.0 ?high-speed pwm module (d spic33epxxxmc20x/50x and pic24epxxxmc20x devices only)? for more information. 4: not all pins are available in all packages variants. see the ?pin diagrams? section for pin availability.
? 2011 microchip technology inc. preliminary ds70657d-page 25 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 2.0 guidelines for getting started with 16-bit digital signal controllers and microcontrollers 2.1 basic connection requirements getting started with the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x families requires attention to a minimal set of device pin connections before proceeding with development. the following is a list of pin names, which must always be connected: ? all v dd and v ss pins (see section 2.2 ?decoupling capacitors? ) ? all av dd and av ss pins (regardless if adc module is not used) (see section 2.2 ?decoupling capacitors? ) ?v cap (see section 2.3 ?cpu logic filter capacitor connection (v cap )? ) ?mclr pin (see section 2.4 ?master clear (mclr) pin? ) ? pgecx/pgedx pins used for in-circuit serial programming? (icsp?) and debugging purposes (see section 2.5 ?icsp pins? ) ? osc1 and osc2 pins when external oscillator source is used (see section 2.6 ?externa l oscillator pins? ) additionally, the following pins may be required: ?v ref +/v ref - pins are used when external voltage reference for adc module is implemented 2.2 decoupling capacitors the use of decoupling capacitors on every pair of power supply pins, such as v dd , v ss , av dd and av ss is required. consider the following criteria when using decoupling capacitors: ? value and type of capacitor: recommendation of 0.1 f (100 nf), 10-20v. this capacitor should be a low-esr and have resonance frequency in the range of 20 mhz and higher. it is recommended to use ceramic capacitors. ? placement on the printed circuit board: the decoupling capacitors should be placed as close to the pins as possible. it is recommended to place the capacitors on the same side of the board as the device. if space is constricted, the capacitor can be placed on another layer on the pcb using a via; however, ensure that the trace length from the pin to the capacitor is within one-quarter inch (6 mm) in length. ? handling high frequency noise: if the board is experiencing high frequency noise, above tens of mhz, add a second ceramic-type capacitor in parallel to the above described decoupling capacitor. the value of the second capacitor can be in the range of 0.01 f to 0.001 f. place this second capacitor next to the primary decoupling capacitor. in high-speed circuit designs, consider implementing a decade pair of capacitances as close to the power and ground pins as possible. for example, 0.1 f in parallel with 0.001 f. ? maximizing performance: on the board layout from the power supply circuit, run the power and return traces to the decoupling capacitors first, and then to the device pins. this ensures that the decoupling capacitors are first in the power chain. equally important is to keep the trace length between the capacitor and the power pins to a minimum, thereby reducing pcb track inductance. note 1: this data sheet summ arizes the features of the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x families of devices. it is not intended to be a compre- hensive reference source. to comple- ment the information in this data sheet, refer to the relat ed section of the ? dspic33e/pic24e family reference manual? , which is available from the microchip web site ( www.microchip.com ) 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for de vice-specific register and bit information. note: the av dd and av ss pins must be connected independent of the adc voltage reference source.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 26 preliminary ? 2011 microchip technology inc. figure 2-1: recommended minimum connection 2.2.1 tank capacitors on boards with power traces running longer than six inches in length, it is suggested to use a tank capacitor for integrated circuits including dscs to supply a local power source. the value of the tank capacitor should be determined based on the trace resistance that con- nects the power supply sour ce to the device, and the maximum current drawn by the device in the applica- tion. in other words, select the tank capacitor so that it meets the acceptable voltage sag at the device. typical values range from 4.7 f to 47 f. 2.3 cpu logic filter capacitor connection (v cap ) a low-esr (< 1 ohms) capacitor is required on the v cap pin, which is used to stabilize the voltage regulator output voltage. the v cap pin must not be connected to v dd , and must have a capacitor greater than 4.7 f (10 f is recommended), 16v connected to ground. the type can be ceramic or tantalum. see section 30.0 ?electrical characteristics? for additional information. the placement of this capacitor should be close to the v cap pin. it is recommended that the trace length not exceeds one-quarter inch (6 mm). see section 27.3 ?on-chip voltage regulator? for details. 2.4 master clear (mclr ) pin the mclr pin provides two specific device functions: ? device reset ? device programming and debugging. during device programming and debugging, the resistance and capacitance that can be added to the pin must be considered. device programmers and debuggers drive the mclr pin. consequently, specific voltage levels (v ih and v il ) and fast signal transitions must not be adve rsely affected. therefore, specific values of r and c will need to be adjusted based on the application and pcb requirements. for example, as shown in figure 2-2 , it is recommended that the capaci tor c, be isolated from the mclr pin during programming and debugging operations. place the components as shown in figure 2-2 within one-quarter inch (6 mm) from the mclr pin. figure 2-2: example of mclr pin connections dspic33e/pic24e v dd v ss v dd v ss v ss v dd av dd av ss v dd v ss 0.1 f ceramic 0.1 f ceramic 0.1 f ceramic 0.1 f ceramic c r v dd mclr 0.1 f ceramic v cap l1 (1) r1 10 f tantalum note 1: as an option, instead of a hard-wired connection, an inductor (l1) can be substituted between v dd and av dd to improve adc noise rejection. the inductor impedance should be less than 1 and the inductor capacity greater than 10 ma. where: f f cnv 2 ------------- - = f 1 2 lc () ----------------------- = l 1 2 fc () --------------------- ?? ?? 2 = (i.e., adc conversion rate/2) note 1: r 10 k is recommended. a suggested starting value is 10 k . ensure that the mclr pin v ih and v il specifications are met. 2: r1 470 will limit any current flowing into mclr from the external capacitor c, in the event of mclr pin breakdown, due to electrostatic discharge (esd) or electrical overstress (eos). ensure that the mclr pin v ih and v il specifications are met. c r1 (2) r (1) v dd mclr dspic33ep/pic24ep jp
? 2011 microchip technology inc. preliminary ds70657d-page 27 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 2.5 icsp pins the pgecx and pgedx pins are used for icsp and debugging purposes. it is recommended to keep the trace length between the icsp connector and the icsp pins on the device as short as possible. if the icsp con- nector is expected to experience an esd event, a series resistor is recommended, with the value in the range of a few tens of ohms, not to exceed 100 ohms. pull-up resistors, series diodes and capacitors on the pgecx and pgedx pins are not recommended as they will interfere with the programmer/debugger communi- cations to the device. if such discrete components are an application requirement, they should be removed from the circuit during programming and debugging. alternatively, refer to t he ac/dc characteristics and timing requirements information in the respective device flash programming spec ification for information on capacitive loading limits and pin input voltage high (v ih ) and input low (v il ) requirements. ensure that the ?communication channel select? (i.e., pgecx/pgedx pins) programmed into the device matches the physical con nections for the icsp to mplab ? pickit? 3, mplab icd 3, or mplab real ice?. for more information on icd 2, icd 3 and real ice connection requirements, refer to the following documents that are available on the microchip web site. ? ?using mplab ? icd 3? (poster) ds51765 ? ?mplab ? icd 3 design advisory? ds51764 ? ?mplab ? real ice? in-circuit emulator user?s guide? ds51616 ? ?using mplab ? real ice? in-circuit emulator? (poster) ds51749 2.6 external oscillator pins many dscs have options for at least two oscillators: a high-frequency primary oscillator and a low-frequency secondary oscillator. for details, see section 9.0 ?oscillator configuration? for details. the oscillator circuit should be placed on the same side of the board as the device. also, place the oscillator circuit close to t he respective oscillator pins, not exceeding one-half inch (12 mm) distance between them. the load capacitors should be placed next to the oscillator itself, on the same side of the board. use a grounded copper pour around the oscillator circuit to isolate them from surrounding circuits. the grounded copper pour should be routed directly to the mcu ground. do not run any signal traces or power traces inside the ground pour. also, if using a two-sided board, avoid any traces on the other side of the board wher e the crystal is placed. a suggested layout is shown in figure 2-3 . figure 2-3: suggested placement of the oscillator circuit main oscillator guard ring guard trace oscillator pins
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 28 preliminary ? 2011 microchip technology inc. 2.7 oscillator value conditions on device start-up if the pll of the target device is enabled and configured for the device start-up oscillator, the maximum oscillator source frequency must be limited to 3 mhz < f in < 5.5 mhz to comply with device pll start-up conditions. this means that if the external oscillator frequency is outside this range, the application must start-up in the frc mode first. the default pll settings after a por with an oscillator frequency outside this range will violate the device operating speed. once the device powers up, the application firmware can initialize the pll sfrs, clkdiv and plldbf to a suitable value, and then perform a clock switch to the oscillator + pll clock source . note that clock switching must be enabled in the device configuration word. 2.8 unused i/os unused i/o pins should be configured as outputs and driven to a logic-low state. alternatively, connect a 1k to 10k resistor between v ss and unused pins and drive the output to logic low. 2.9 application examples ? induction heating ? uninterruptable power supplies (ups) ? dc/ac inverters ? compressor motor control ? washing machine 3-phase motor control ? bldc motor control ? automotive hvac, cooling fans, fuel pumps ? stepper motor control ? audio and fluid sensor monitoring ? camera lens focus and stability control ? speech (playback, hands-free kits, answering machines, voip) ? consumer audio ? industrial and building c ontrol (security systems and access control) ? barcode reading ? networking: lan switches, gateways ? data storage device management ? smart cards and smart card readers examples of typical application connections are shown in figure 2-4 through figure 2-8 . figure 2-4: boost converter implementation i pfc v output adc channel op amp/ adc channel pwm k 1 k 2 k 3 fet dspic33ep v input comparator output driver
? 2011 microchip technology inc. preliminary ds70657d-page 29 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x figure 2-5: single-phase synchronous buck converter figure 2-6: multi-phase synchronous buck converter k 1 op amp/ comparator k 2 k 7 pwm pwm adc channel adc channel 5v output i 5v 12v input fet driver dspic33ep k 5 k 4 k 3 k 6 k 7 op amp/comparator op amp/comparator adc channel op amp/comparator adc channel pwm pwm pwm pwm pwm pwm 3.3v output 12v input fet driver fet driver fet driver dspic33ep
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 30 preliminary ? 2011 microchip technology inc. figure 2-7: interleaved pfc figure 2-8: bemf voltage measured using the adc module v ac v out + op amp/comparator pwm adc pwm |v ac | k 4 k 3 fet dspic33ep driver v out - adc channel fet driver op amp/ k 1 k 2 comparator channel op amp/ comparator 3-phase inverter pwm3h pwm3l pwm2h pwm2l pwm1h pwm1l flt x fault bldc dspic33ep/pic24ep an3 an4 an5 an2 demand phase terminal voltage feedback r49 r41 r34 r36 r44 r52
? 2011 microchip technology inc. preliminary ds70657d-page 31 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 3.0 cpu the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/ 50x, and pic24epxxxgp/mc20x cpu have a 16-bit (data) modified harvard architecture with an enhanced instruction set, including si gnificant support for digital signal processing. the cpu has a 24-bit instruction word, with a variable length opcode field. the program counter (pc) is 23 bits wide and addresses up to 4m x 24 bits of user program memory space. an instruction prefetch mechanism helps maintain throughput and provides pr edictable execution. most instructions execute in a single-cycle effective execu- tion rate, with the exception of instructions that change the program flow, the double-word move ( mov.d ) instruction, psv accesses, an d the table instructions. overhead free program loop constructs are supported using the do and repeat instructions, both of which are interruptible at any point. 3.1 registers the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/ 50x, and pic24epxxxgp/mc20x devices have six- teen 16-bit working registers in the programmer?s model. each of the working registers can act as a data, address or address offset register. the 16th working register (w15) operates as a software stack pointer for interrupts and calls. 3.2 instruction set the instruction set fo r DSPIC33EPXXXGP50X and dspic33epxxxmc20x/50x devices has two classes of instructions: the mcu class of instructions and the dsp class of instructions. the instruction set for pic24epxxxgp/mc20x devices has the mcu class of instructions only and does not support dsp instructions. these two instruction classe s are seamlessly integrated into the architecture and exec ute from a single execution unit. the instruction set includes many addressing modes and was designed for optimum c compiler efficiency. 3.3 data space addressing the base data space can be addressed as 4k words or 8 kbytes and is sp lit into two blocks, referred to as x and y data memory. each memory block has its own independent address generation unit (agu). the mcu class of instructions operate solely through the x memory agu, which accesses the entire memory map as one linear data space. on dspic33epxxxmc20x/ 50x and DSPIC33EPXXXGP50X devices, certain dsp instructions operate throug h the x and y agus to sup- port dual operand reads, which splits the data address space into two parts. the x and y data space boundary is device specific. the upper 4 kbytes of the data space memory map can optionally be mapped into program space at any 16k program word boundary. the program-to-data-space mapping feature, known as program space visibility (psv), lets any instruction access program space as if it were data space. moreover, the base data space address is used in conjunction with a read or write page register (dsrpag or dswpag) to form an extended data space (eds) address. the eds can be addressed as 8 mwords or 16 mbytes. refer to section 3. ?data memory? (ds70595) and section 4. ?program memory? (ds70613) in the ?dspic33e/ pic24e family reference manual? for more details on eds, psv and table accesses. on dspic33epxxxmc20x/50x and DSPIC33EPXXXGP50X devices, overhead-free circular buffers (modulo addressing) are supported in both x and y address spaces. the modulo addressing removes the software boundary-checking overhead for dsp algorithms. the x agu circular addressing can be used with any of the mcu class of instructions. the x agu also supports bit-reverse addressing to greatly simplify input or output data reordering for radix-2 fft algorithms. pic24epxxxgp/mc20x devices do not support modulo and bit-reverse addressing. 3.4 addressing modes the cpu supports these addressing modes: ? inherent (no operand) ? relative ?literal ? memory direct ? register direct ? register indirect each instruction is associated with a predefined addressing mode group, depending upon its functional requirements. as many as six addressing modes are supported for each instruction. note 1: this data sheet summ arizes the features of the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x families of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to section 2. ?cpu? (ds70359) in the ? dspic33e/pic24e family reference manual ?, which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for de vice-specific register and bit information.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 32 preliminary ? 2011 microchip technology inc. figure 3-1: DSPIC33EPXXXGP50X, dspic 33epxxxmc20x/50x, and pic24epxxxgp/mc20x cpu block diagram instruction decode and control 16 pch pcl 16 program counter 16-bit alu 24 24 24 24 x data bus ir pcu 16 16 16 16 x 16 w register array divide support engine (1) dsp rom latch 16 y data bus (1) ea mux x ragu x wagu y agu (1) 16 24 16 16 16 16 16 16 16 8 interrupt controller psv and table data access control block stack control logic loop control logic data latch data latch y data ram (1) x data ram address latch address latch 16 data latch 16 16 16 x address bus y address bus 24 literal data program memory address latch power, reset, and oscillator control signals to various blocks ports peripheral modules note 1: this feature is not availabl e on pic24epxxxgp/mc20x devices. modules
? 2011 microchip technology inc. preliminary ds70657d-page 33 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 3.5 programmer?s model the programmer?s model for the DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x is shown in figure 3-2 . all registers in the prog rammer?s model are memory mapped and can be manipulated directly by instructions. table 3-1 lists a description of each register. in addition to the registers contained in the programmer?s model, the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/ mc20x devices contain cont rol registers for modulo addressing (dspic33 epxxxmc20x/50x and DSPIC33EPXXXGP50X devices only), bit-reversed addressing (dspic33 epxxxmc20x/50x and DSPIC33EPXXXGP50X devices only) and interrupts. these registers are described in subsequent sections of this document. all registers associated with the programmer?s model are memory mapped, as shown in ta b l e 4 - 1 . table 3-1: programmer?s mode l register descriptions register(s) name description w0 through w15 working register array acca, accb 40-bit dsp accumulators pc 23-bit program counter sr alu and dsp engine status register splim stack pointer limit value register tblpag table memory page address register dsrpag extended data space (eds) read page register dswpag extended data space (eds) write page register rcount repeat loop count register dcount (1) do loop count register dostarth (1,2) , dostartl (1,2) do loop start address register (high and low) doendh (1) , doendl (1) do loop end address register (high and low) corcon contains dsp engine, do loop control and trap status bits note 1: this register is available on dspic33epx xxmc20x/50x and DSPIC33EPXXXGP50X devices only. 2: the dostarth and dostartl registers are read-only.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 34 preliminary ? 2011 microchip technology inc. figure 3-2: programmer?s model novz c tblpag pc23 pc0 7 0 d0 d15 program counter data table page address status register working/address registers dsp operand registers w0 (wreg) w1 w2 w3 w4 w5 w6 w7 w8 w9 w10 w11 w12 w13 frame pointer/w14 stack pointer/w15* dsp address registers ad39 ad0 ad31 dsp accumulators (1) acca accb dsrpag 9 0 ra 0 oa (1) ob (1) sa (1) sb (1) rcount 15 0 repeat loop counter dcount 15 0 do loop counter and stack (1) dostart 23 0 do loop start address and stack (1) 0 doend do loop end address and stack (1) ipl2 ipl1 splim* stack pointer limit ad15 23 0 srl ipl0 push.s and pop.s shadows nested do stack 0 0 oab (1) sab (1) x data space read page address da (1) dc 0 0 0 0 dswpag x data space write page address 8 0 note 1: this feature or bit is available on dspic 33epxxxmc20x/50x and DSPIC33EPXXXGP50X devices only. corcon 15 0 cpu core control register
? 2011 microchip technology inc. preliminary ds70657d-page 35 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 3.6 cpu resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 3.6.1 key resources ? section 2. ?cpu? (ds70359) ? code samples ? application notes ? software libraries ? webinars ? all related dspic33e/pic24e family reference manuals sections ? development tools note: in the event you are not able to access the product page using t he link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 36 preliminary ? 2011 microchip technology inc. 3.7 cpu control registers register 3-1: sr: cpu status register r/w-0 r/w-0 r/w-0 r/w-0 r/c-0 r/c-0 r -0 r/w-0 oa (1) ob (1) sa (1,4) sb (1,4) oab (1) sab (1) da (1) dc bit 15 bit 8 r/w-0 (2,3) r/w-0 (2,3) r/w-0 (2,3) r-0 r/w-0 r/w-0 r/w-0 r/w-0 ipl<2:0> ra n ov z c bit 7 bit 0 legend: u = unimplemented bit, read as ?0? r = readable bit w = writable bit c = clearable bit -n = value at por ?1?= bit is set ?0? = bit is cleared x = bit is unknown bit 15 oa: accumulator a overflow status bit (1) 1 = accumulator a has overflowed 0 = accumulator a has not overflowed bit 14 ob: accumulator b overflow status bit (1) 1 = accumulator b has overflowed 0 = accumulator b has not overflowed bit 13 sa: accumulator a saturation ?sticky? status bit (1,4) 1 = accumulator a is saturated or has been saturated at some time 0 = accumulator a is not saturated bit 12 sb: accumulator b saturation ?sticky? status bit (1,4) 1 = accumulator b is saturated or has been saturated at some time 0 = accumulator b is not saturated bit 11 oab: oa || ob combined accumu lator overflow status bit (1) 1 = accumulators a or b have overflowed 0 = neither accumulators a or b have overflowed bit 10 sab: sa || sb combined accumula tor ?sticky? status bit (1) 1 = accumulators a or b are saturat ed or have been saturated at some time 0 = neither accumulator a or b are saturated bit 9 da: do loop active bit (1) 1 = do loop in progress 0 = do loop not in progress bit 8 dc: mcu alu half carry/borrow bit 1 = a carry-out from the 4th low order bit (for byte-sized data) or 8th low order bit (for word-sized data) of the result occurred 0 = no carry-out from the 4th low order bit (for by te-sized data) or 8th low order bit (for word-sized data) of the result occurred note 1: this bit is available on dspic33epxxxmc20x /50x and DSPIC33EPXXXGP50X devices only. 2: the ipl<2:0> bits are concatenated with the ipl<3> bi t (corcon<3>) to form the cpu interrupt priority level. the value in parentheses indicates the ipl, if ipl<3> = 1 . user interrupts are disabled when ipl<3> = 1 . 3: the ipl<2:0> status bits are read only when the nstdis bit (intcon1<15>) = 1 . 4: a data write to the sr register can modify the sa and sb bits by either a data write to sa and sb or by clearing the sab bit. to avoi d a possible sa or sb bit write race co ndition, the sa and sb bits should not be modified using bit operations.
? 2011 microchip technology inc. preliminary ds70657d-page 37 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x bit 7-5 ipl<2:0>: cpu interrupt priority level status bits (1,2) 111 = cpu interrupt priority level is 7 (15). user interrupts disabled 110 = cpu interrupt priority level is 6 (14) 101 = cpu interrupt priority level is 5 (13) 100 = cpu interrupt priority level is 4 (12) 011 = cpu interrupt priority level is 3 (11) 010 = cpu interrupt priority level is 2 (10) 001 = cpu interrupt priority level is 1 (9) 000 = cpu interrupt priority level is 0 (8) bit 4 ra: repeat loop active bit 1 = repeat loop in progress 0 = repeat loop not in progress bit 3 n: mcu alu negative bit 1 = result was negative 0 = result was non-negative (zero or positive) bit 2 ov: mcu alu overflow bit this bit is used for signed arithmetic (2?s compleme nt). it indicates an overflow of the magnitude that causes the sign bit to change state. 1 = overflow occurred for signed arit hmetic (in this arithmetic operation) 0 = no overflow occurred bit 1 z: mcu alu zero bit 1 = an operation that affects the z bit has set it at some time in the past 0 = the most recent operation that affects the z bit has cleared it (i.e., a non-zero result) bit 0 c: mcu alu carry/borrow bit 1 = a carry-out from the most signi ficant bit of the result occurred 0 = no carry-out from the most sign ificant bit of the result occurred register 3-1: sr: cpu status register (continued) note 1: this bit is available on dspic33epxxxmc20x /50x and DSPIC33EPXXXGP50X devices only. 2: the ipl<2:0> bits are concatenated with the ipl<3> bi t (corcon<3>) to form the cpu interrupt priority level. the value in parentheses indicates the ipl, if ipl<3> = 1 . user interrupts are disabled when ipl<3> = 1 . 3: the ipl<2:0> status bits are read only when the nstdis bit (intcon1<15>) = 1 . 4: a data write to the sr register can modify the sa and sb bits by either a data write to sa and sb or by clearing the sab bit. to avoi d a possible sa or sb bit write race co ndition, the sa and sb bits should not be modified using bit operations.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 38 preliminary ? 2011 microchip technology inc. register 3-2: corcon: core control register r/w-0 u-0 r/w-0 r/w-0 r/w-0 r-0 r-0 r-0 var ? us<1:0> (1) edt (1,2) dl<2:0> (1) bit 15 bit 8 r/w-0 r/w-0 r/w-1 r/w-0 r/c-0 r-0 r/w-0 r/w-0 sata (1) satb (1) satdw (1) accsat (1) ipl3 (3) sfa rnd (1) if (1) bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 var: variable exception processing latency control bit 1 = variable exception processing enabled 0 = fixed exception processing enabled bit 14 unimplemented: read as ? 0 ? bit 13-12 us<1:0>: dsp multiply unsigned/signed control bits (1) 11 = reserved 10 = dsp engine multiplies are mixed-sign 01 = dsp engine multiplies are unsigned 00 = dsp engine multiplies are signed bit 11 edt: early do loop termination control bit (1,2) 1 = terminate executing do loop at end of current loop iteration 0 = no effect bit 10-8 dl<2:0>: do loop nesting level status bits (1) 111 = 7 do loops active ? ? ? 001 = 1 do loop active 000 = 0 do loops active bit 7 sata: acca saturation enable bit (1) 1 = accumulator a saturation enabled 0 = accumulator a saturation disabled bit 6 satb: accb saturation enable bit (1) 1 = accumulator b saturation enabled 0 = accumulator b saturation disabled bit 5 satdw: data space write from dsp engine saturation enable bit (1) 1 = data space write saturation enabled 0 = data space write saturation disabled bit 4 accsat: accumulator saturation mode select bit (1) 1 = 9.31 saturation (super saturation) 0 = 1.31 saturation (normal saturation) bit 3 ipl3: cpu interrupt priority level status bit 3 (3) 1 = cpu interrupt priority level is greater than 7 0 = cpu interrupt priority level is 7 or less note 1: this bit is available on dspic33epxxxmc20x /50x and DSPIC33EPXXXGP50X devices only. 2: this bit is always read as ? 0 ?. 3: the ipl3 bit is concatenated with t he ipl<2:0> bits (sr<7:5>) to form the cpu interrupt priority level.
? 2011 microchip technology inc. preliminary ds70657d-page 39 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x bit 2 sfa: stack frame active status bit 1 = stack frame is active. w14 and w15 address 0x0000 to 0xffff, regardless of dsrpag and dsw- pag values 0 = stack frame is not active. w14 and w15 address of eds or base data space bit 1 rnd: rounding mode select bit (1) 1 = biased (conventional) rounding enabled 0 = unbiased (convergent) rounding enabled bit 0 if: integer or fractional multiplier mode select bit (1) 1 = integer mode enabled for dsp multiply 0 = fractional mode enabled for dsp multiply register 3-2: corcon: core co ntrol register (continued) note 1: this bit is available on dspic33epxxxmc20x /50x and DSPIC33EPXXXGP50X devices only. 2: this bit is always read as ? 0 ?. 3: the ipl3 bit is concatenated with t he ipl<2:0> bits (sr<7:5>) to form the cpu interrupt priority level.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 40 preliminary ? 2011 microchip technology inc. 3.8 arithmetic logic unit (alu) the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/ 50x, and pic24epxxxgp/mc20x alu is 16 bits wide and is capable of addition, subtraction, bit shifts and logic operations. unless otherwise mentioned, arithmetic operati ons are two?s complement in nature. depending on the operation, the alu can affect the values of the carry (c), zero (z), negative (n), overflow (ov) and digit carry (dc) status bits in the sr register. the c and dc status bits operate as borrow and digit borrow bits, respectively, for subtraction operations. the alu can perform 8-bit or 16-bit operations, depending on the mode of t he instruction that is used. data for the alu operation can come from the w register array or data memory, depending on the addressing mode of the instruction. likewise, output data from the alu can be writte n to the w register array or a data memory location. refer to the ?16-bit mcu and dsc programmer?s reference manual? (ds70157) for information on the sr bits affected by each instruction. the core cpu incorporates hardware support for both multiplication and division. this includes a dedicated hardware multiplier and support hardware for 16-bit divisor division. 3.8.1 multiplier using the high-speed 17-bit x 17-bit multiplier, the alu supports unsigned, signed, or mixed-sign operation in several mcu multip lication modes: ? 16-bit x 16-bit signed ? 16-bit x 16-bit unsigned ? 16-bit signed x 5-bit (literal) unsigned ? 16-bit signed x 16-bit unsigned ? 16-bit unsigned x 5-bit (literal) unsigned ? 16-bit unsigned x 16-bit signed ? 8-bit unsigned x 8-bit unsigned 3.8.2 divider the divide block supports 32- bit/16-bit and 16-bit/16-bit signed and unsigned integer divide operations with the following data sizes: ? 32-bit signed/16-bit signed divide ? 32-bit unsigned/16-bit unsigned divide ? 16-bit signed/16-bit signed divide ? 16-bit unsigned/16-bit unsigned divide the quotient for all divide instructions ends up in w0 and the remainder in w1. 16-bit signed and unsigned div instructions can specif y any w register for both the 16-bit divisor (wn) and any w register (aligned) pair (w(m + 1):wm) for the 32-bit dividend. the divide algorithm takes one cycle per bit of divisor, so both 32-bit/16-bit and 16-bit/16- bit instructi ons take the same number of cycles to execute. 3.9 dsp engine (dspic33epxxxmc20x/50x and DSPIC33EPXXXGP50X devices only) the dsp engine consists of a high-speed 17-bit x 17-bit multiplier, a 40-bit barrel shifter and a 40-bit adder/subtracter (with two ta rget accumulators, round and saturation logic). the dsp engine can also perform inherent accumula- tor-to-accumulator operations that require no additional data. these instructions are add, sub and neg . the dsp engine has options selected through bits in the cpu core control register (corcon), as listed below: ? fractional or integer dsp multiply (if) ? signed, unsigned, or mixed-sign dsp multiply (us) ? conventional or convergent rounding (rnd) ? automatic saturation on/off for acca (sata) ? automatic saturation on/off for accb (satb) ? automatic saturation on/off for writes to data memory (satdw) ? accumulator saturati on mode selection (accsat) table 3-2: dsp instructions summary instruction algebraic operation acc write back clr a = 0 yes ed a = (x ? y) 2 no edac a = a + (x ? y) 2 no mac a = a + (x ? y) yes mac a = a + x 2 no movsac no change in a yes mpy a = x ? y no mpy a = x 2 no mpy.n a = ? x ? y no msc a = a ? x ? y yes
? 2011 microchip technology inc. preliminary ds70657d-page 41 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 4.0 memory organization the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/ 50x, and pic24epxxxgp/mc20x architecture features separate program and data memory spaces and buses. this architecture also allows the direct access of program memory from the data space during code execution. 4.1 program address space the program address memory space of the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x devices is 4m instructions. the space is addressable by a 24-bit value derived either from the 23-bit pc during program execution, or from table operation or data space remapping as described in section 4.8 ?interfacing program and data memory spaces? . user application access to the program memory space is restricted to the lower half of the address range (0x000000 to 0x7fffff). the exception is the use of tblrd operations, which use tblpag<7> to read device id sections of the configuration memory space. the program memory maps, which are presented by device family and memory size, are shown in figure 4-1 through figure 4-4 . figure 4-1: program memory map for ds pic33ep32gp50x, dspi c33ep32mc20x/50x, and pic24ep32gp/mc20x devices (1) note: this data sheet summ arizes the features of the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x families of devices. it is not intended to be a compre- hensive reference source. to complement the information in this data sheet, refer to section 4. ?program memory? (ds70613) of the ? dspic33e/pic24e family reference manual ?, which is avail- able from the microchip web site ( www.microchip.com ). reset address 0x000000 0x000002 write user program flash memory 0x0057ec 0x0057ea (11.2k instructions) 0x800000 0xfa0000 latches 0xfa0002 0xfa0004 devid 0xfefffe 0xff0000 0xfffffe 0xf9fffe unimplemented (read ? 0 ?s) goto instruction 0x000004 reserved 0x7ffffe reserved 0x000200 0x0001fe interrupt vector table configuration memory space user memory space flash configuration bytes 0x006800 0x0057fe reserved 0xff0002 note 1: memory areas are not shown to scale. 2: on reset, these bits are automatically copied into the device configuration shadow registers. 0xff0004 reserved 0x800ff8 0x800ff6 0x801000 0x800ffe userid
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 42 preliminary ? 2011 microchip technology inc. figure 4-2: program memory map for ds pic33ep64gp50x, dspi c33ep64mc20x/50x, and pic24ep64gp/mc20x devices (1) reset address 0x000000 0x000002 write user program flash memory 0x00afec 0x00afea (22.5k instructions) 0x800000 0xfa0000 latches 0xfa0002 0xfa0004 devid 0xfefffe 0xff0000 0xfffffe 0xf9fffe unimplemented (read ? 0 ?s) goto instruction 0x000004 reserved 0x7ffffe reserved 0x000200 0x0001fe interrupt vector table configuration memory space user memory space flash configuration bytes 0x00b000 0x00affe reserved 0xff0002 note 1: memory areas are not shown to scale. 2: on reset, these bits are automatically copied into the device configuration shadow registers. 0xff0004 reserved 0x800ff8 0x800ff6 0x801000 0x800ffe userid
? 2011 microchip technology inc. preliminary ds70657d-page 43 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x figure 4-3: program memory map for dspi c33ep128gp50x, dspi c33ep128mc20x/50x, and pic24ep128gp/mc20x devices (1) reset address 0x000000 0x000002 write user program flash memory 0x0157ec 0x0157ea (44k instructions) 0x800000 0xfa0000 latches 0xfa0002 0xfa0004 devid 0xfefffe 0xff0000 0xfffffe 0xf9fffe unimplemented (read ? 0 ?s) goto instruction 0x000004 reserved 0x7ffffe reserved 0x000200 0x0001fe interrupt vector table configuration memory space user memory space flash configuration bytes 0x015800 0x0157fe reserved 0xff0002 note 1: memory areas are not shown to scale. 2: on reset, these bits are automatically copied into the device configuration shadow registers. 0xff0004 reserved 0x800ff8 0x800ff6 0x801000 0x800ffe userid
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 44 preliminary ? 2011 microchip technology inc. figure 4-4: program memory map for dspi c33ep256gp50x, dspi c33ep256mc20x/50x, and pic24ep256gp/mc20x devices (1) reset address 0x000000 0x000002 write user program flash memory 0x02afec 0x02afea (88k instructions) 0x800000 0xfa0000 latches 0xfa0002 0xfa0004 devid 0xfefffe 0xff0000 0xfffffe 0xf9fffe unimplemented (read ? 0 ?s) goto instruction 0x000004 reserved 0x7ffffe reserved 0x000200 0x0001fe interrupt vector table configuration memory space user memory space flash configuration bytes 0x02b000 0x02affe reserved 0xff0002 note 1: memory areas are not shown to scale. 2: on reset, these bits are automatically copied into the device configuration shadow registers. 0xff0004 reserved 0x800ff8 0x800ff6 0x801000 0x800ffe userid
? 2011 microchip technology inc. preliminary ds70657d-page 45 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 4.1.1 program memory organization the program memory space is organized in word- addressable blocks. although it is treated as 24 bits wide, it is more appropriate to think of each address of the program memory as a lower and upper word, with the upper byte of the upper word being unimplemented. the lower word always has an even address, while the upper word has an odd address ( figure 4-5 ). program memory addresses are always word-aligned on the lower word, and addresses are incremented or decremented by two during code execution. this arrangement provides compatibility with data memory space addressing and makes data in the program memory space accessible. 4.1.2 interrupt and trap vectors all DSPIC33EPXXXGP50X, dspic33epxxxmc20x/ 50x, and pic24epxxxgp/mc 20x devices reserve the addresses between 0x00000 and 0x000200 for hard-coded program execut ion vectors. a hardware reset vector is provided to redirect code execution from the default value of the pc on device reset to the actual start of code. a goto instruction is programmed by the user application at address 0x000000 of flash memory, with the actual address for the start of code at address 0x000002 of flash memory. a more detailed discussion of the interrupt vector tables is provided in section 7.1 ?interrupt vector table? . figure 4-5: program memory organization 0 8 16 pc address 0x000000 0x000002 0x000004 0x000006 23 00000000 00000000 00000000 00000000 program memory ?phantom? byte (read as ? 0 ?) least significant word most significant word instruction width 0x000001 0x000003 0x000005 0x000007 msw address (lsw address)
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 46 preliminary ? 2011 microchip technology inc. 4.2 data address space the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/ 50x, and pic24epxxxgp/mc20x cpu has a separate 16-bit wide data memory space. the data space is accessed using separate address generation units (agus) for read and write operations. the data memory maps, which are presented by device family and memory size, are shown in figure 4-6 through figure 4-13 . all effective addresses (eas) in the data memory space are 16 bits wide and point to bytes within the data space. this arrangement gives a base data space address range of 8 kbytes or 4k words. the base data space address is used in conjunction with a read or write page register (dsrpag or dswpag) to form an extended data space, which has a total address range of 16 mb. DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x dev ices implement up to 56 kbytes of data memory. if an ea point to a location outside of this area, an all-zero word or byte is returned. 4.2.1 data space width the data memory space is organized in byte addressable, 16-bit wide blocks. data is aligned in data memory and registers as 16-bit words, but all data space eas resolve to bytes. the least significant bytes (lsbs) of each word have even addresses, while the most significant bytes (msbs) have odd addresses. 4.2.2 data memory organization and alignment to maintain backward compatibility with pic ? mcu devices and improve data space memory usage efficiency, the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/ mc20x instruction set supports both word and byte operations. as a consequence of byte accessibility, all effective address calculations are internally scaled to step through word-aligned memory. for example, the core recognizes that post-modified register indirect addressing mode [ws++] resu lts in a value of ws + 1 for byte operations and ws + 2 for word operations. a data byte read, reads the complete word that contains the byte, using the lsb of any ea to determine which byte to select. the selected byte is placed onto the lsb of the data path. that is, data memory and registers are organized as two parallel byte-wide entities with shared (word) address decode but separate write lines. data by te writes only write to the corresponding side of the array or register that matches the byte address. all word accesses must be aligned to an even address. misaligned word data fetches are not supported, so care must be taken when mixing byte and word operations, or translating from 8-bit mcu code. if a misaligned read or write is attempted, an address error trap is generated. if the error occurred on a read, the instruction underway is completed. if the error occurred on a write, the instruction is executed but the write does not occur. in either case, a trap is then executed, allowing the system and/or user application to examine the machine state prior to execution of the address fault. all byte loads into any w register are loaded into the lsb. the msb is not modified. a sign-extend instruction ( se ) is provided to allow user applications to translate 8-bit signed data to 16-bit signed values. alternatively, for 16-bit unsigned data, user applications can clear the msb of any w register by executing a zero-extend ( ze ) instruction on the appropriate address. 4.2.3 sfr space the first 4 kbytes of the near data space, from 0x0000 to 0x0fff, is primarily occupied by special function registers (sfrs). these are used by the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x core and peripheral modules for controlling the operation of the device. sfrs are distributed amon g the modules that they control, and are generally grouped together by module. much of the sfr space contains unused addresses; these are read as ? 0 ?. 4.2.4 near data space the 8 kbyte area between 0x0000 and 0x1fff is referred to as the near dat a space. locations in this space are directly addressable through a 13-bit abso- lute address field within all memory direct instructions. additionally, the whole data space is addressable using mov instructions, which support memory direct addressing mode with a 16-bit address field, or by using indirect addressing mode using a working register as an address pointer. note: the actual set of peripheral features and interrupts varies by the device. refer to the corresponding device tables and pinout diagrams for device-specific information.
? 2011 microchip technology inc. preliminary ds70657d-page 47 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x figure 4-6: data memory map for dspic 33ep32mc20x/50x and dspic33ep32gp50x devices 0x0000 0x0ffe 0x17fe 0xfffe lsb address 16 bits lsb msb msb address 0x0001 0x0fff 0x17ff 0xffff optionally mapped into program memory space 0x1fff 0x1ffe 0x1001 0x1000 0x1801 0x1800 4 kbyte sfr space 4 kbyte sram space 0x2000 0x2001 space data near 8 kbyte sfr space x data ram (x) x data unimplemented (x) y data ram (y) 0x8000 0x8001 note: memory areas are not shown to scale. (psv
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 48 preliminary ? 2011 microchip technology inc. figure 4-7: data memory map for dspic 33ep64mc20x/50x and dspic33ep64gp50x devices 0x0000 0x0ffe 0x1ffe 0xfffe lsb address 16 bits lsb msb msb address 0x0001 0x0fff 0x1fff 0xffff optionally mapped into program memory space 0x2fff 0x2ffe 0x1001 0x1000 0x2001 0x2000 4 kbyte sfr space 8 kbyte sram space 0x3000 0x3001 space data near 8 kbyte sfr space x data ram (x) x data unimplemented (x) y data ram (y) 0x8000 0x8001 note: memory areas are not shown to scale. (psv
? 2011 microchip technology inc. preliminary ds70657d-page 49 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x figure 4-8: data memory map for dspic 33ep128mc20x/50x and dspic33ep128gp50x devices 0x0000 0x0ffe 0x2ffe 0xfffe lsb address 16 bits lsb msb msb address 0x0001 0x0fff 0x2fff 0xffff optionally mapped into program memory space 0x4fff 0x4ffe 0x1001 0x1000 0x3001 0x3000 4 kbyte sfr space 16 kbyte sram space 0x5000 0x5001 space data near 8 kbyte sfr space x data ram (x) x data unimplemented (x) y data ram (y) 0x8000 0x8001 note: memory areas are not shown to scale. (psv 0x1ffe 0x1fff 0x2001 0x2000
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 50 preliminary ? 2011 microchip technology inc. figure 4-9: data memory map for dspic 33ep256mc20x/50x and dspic33ep256gp50x devices 0x0000 0x0ffe 0x4ffe 0xfffe lsb address 16 bits lsb msb msb address 0x0001 0x0fff 0x4fff 0xffff optionally mapped into program memory space 0x8fff 0x8ffe 0x1001 0x1000 0x5001 0x5000 4 kbyte sfr space 32 kbyte sram space 0x9000 0x9001 space data near 8 kbyte sfr space x data ram (x) x data unimplemented (x) y data ram (y) note: memory areas are not shown to scale. (psv 0x1ffe 0x1fff 0x2001 0x2000 0x7ffe 0x7fff 0x8001 0x8000
? 2011 microchip technology inc. preliminary ds70657d-page 51 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x figure 4-10: data memory map fo r pic24ep32gp/mc 20x/50x devices 0x0000 0x0ffe 0x17fe 0xfffe lsb address 16 bits lsb msb msb address 0x0001 0x0fff 0x17ff 0xffff optionally mapped into program memory space 0x1fff 0x1ffe 0x1001 0x1000 0x1801 0x1800 4 kbyte sfr space 4 kbyte sram space 0x2000 0x2001 space data near 8 kbyte sfr space x data ram (x) x data unimplemented (x) 0x8000 0x8001 note: memory areas are not shown to scale. (psv
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 52 preliminary ? 2011 microchip technology inc. figure 4-11: data memory map fo r pic24ep64gp/mc 20x/50x devices 0x0000 0x0ffe 0x1ffe 0xfffe lsb address 16 bits lsb msb msb address 0x0001 0x0fff 0x1fff 0xffff optionally mapped into program memory space 0x2fff 0x2ffe 0x1001 0x1000 0x2001 0x2000 4 kbyte sfr space 8 kbyte sram space 0x3000 0x3001 space data near 8 kbyte sfr space x data ram (x) x data unimplemented (x) 0x8000 0x8001 note: memory areas are not shown to scale. (psv
? 2011 microchip technology inc. preliminary ds70657d-page 53 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x figure 4-12: data memory map for pic24128gp/mc20x /50x devices 0x0000 0x0ffe 0xfffe lsb address 16 bits lsb msb msb address 0x0001 0x0fff 0xffff optionally mapped into program memory space 0x4fff 0x4ffe 0x1001 0x1000 4 kbyte sfr space 16 kbyte sram space 0x5000 0x5001 space data near 8 kbyte sfr space x data ram (x) x data unimplemented (x) 0x8000 0x8001 note: memory areas are not shown to scale. (psv 0x1ffe 0x1fff 0x2001 0x2000
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 54 preliminary ? 2011 microchip technology inc. figure 4-13: data memory map for pic24ep256gp/mc 20x/50x devices 0x0000 0x0ffe 0xfffe lsb address 16 bits lsb msb msb address 0x0001 0x0fff 0xffff optionally mapped into program memory space 0x8fff 0x8ffe 0x1001 0x1000 4 kbyte sfr space 32 kbyte sram space 0x9000 0x9001 space data near 8 kbyte sfr space x data ram (x) x data unimplemented (x) note: memory areas are not shown to scale. (psv 0x1ffe 0x1fff 0x2001 0x2000 0x7ffe 0x7fff 0x8001 0x8000
? 2011 microchip technology inc. preliminary ds70657d-page 55 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 4.2.5 x and y data spaces the dspic33epxxxmc20x/50x and DSPIC33EPXXXGP50X core has two data spaces, x and y. these data spaces can be considered either separate (for some dsp instructions), or as one unified linear address range (for m cu instructions). the data spaces are accessed using two address generation units (agus) and separate data paths. this feature allows certain instructions to concurrently fetch two words from ram, thereby enabling efficient execution of dsp algorithms such as finite impulse response (fir) filtering and fast fourier transform (fft). the x data space is used by all instructions and supports all addressing modes. x data space has separate read and write data buses. the x read data bus is the read data path for all instructions that view data space as combined x and y address space. it is also the x data prefetch pa th for the dual operand dsp instructions ( mac class). the y data space is used in concert with the x data space by the mac class of instructions ( clr, ed, edac, mac, movsac, mpy, mpy.n and msc ) to provide two concurrent data read paths. both the x and y data spaces support modulo addressing mode for all instructions, subject to addressing mode restrictions. bit-reversed addressing mode is only supported for writes to x data space. modulo addressing and bit-reversed addressing are not pr esent in pic24epxxxgp/ mc20x devices. all data memory writes, including in dsp instructions, view data space as combined x and y address space. the boundary between the x and y data spaces is device-dependent and is not user-programmable. 4.3 memory resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 4.3.1 key resources ? section 4. ?program memory? (ds70613) ? code samples ? application notes ? software libraries ? webinars ? all related dspic33e/pic24e family reference manuals sections ? development tools note: in the event you are not able to access the product page using the link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
DSPIC33EPXXXGP50X, dspic33epxxxm c20x/50x, and pi c24epxxxgp/mc20x ds70657d-page 56 preliminary ? 2011 microchip technology inc. 4.4 special function register maps table 4-1: cpu core register map for dspic33 epxxxmc20x/50x and dspic33e pxxxgp50x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets w0 0000 w0 (wreg) xxxx w1 0002 w1 xxxx w2 0004 w2 xxxx w3 0006 w3 xxxx w4 0008 w4 xxxx w5 000a w5 xxxx w6 000c w6 xxxx w7 000e w7 xxxx w8 0010 w8 xxxx w9 0012 w9 xxxx w10 0014 w10 xxxx w11 0016 w11 xxxx w12 0018 w12 xxxx w13 001a w13 xxxx w14 001c w14 xxxx w15 001e w15 xxxx splim 0020 splim 0000 accal 0022 accal 0000 accah 0024 accah 0000 accau 0026 sign-extension of acca<39> accau 0000 accbl 0028 accbl 0000 accbh 002a accbh 0000 accbu 002c sign-extension of accb<39> accbu 0000 pcl 002e pcl ? 0000 pch 0030 ? ? ? ? ? ? ? ? ?pch 0000 dsrpag 0032 ? ? ? ? ? ?dsrpag 0001 dswpag 0034 ? ? ? ? ? ? ?dswpag 0001 rcount 0036 rcount 0000 dcount 0038 dcount 0000 dostartl 003a dostartl ? 0000 dostarth 003c ? ? ? ? ? ? ? ? ? ?dostarth 0000 doendl 003e doendl ? 0000 doendh 0040 ? ? ? ? ? ? ? ? ? ? doendh 0000 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011 microchip technology inc. preliminary ds70657d-page 57 DSPIC33EPXXXGP50X, dspi c33epxxxmc20x/50x, and pic24epxxxgp/mc20x sr 0042 oa ob sa sb oab sab da dc ipl2 ipl1 ipl0 ra n ov z c 0000 corcon 0044 var ? us<1:0> edt dl<2:0> sata satb satdw accsat ipl3 sfa rnd if 0020 modcon 0046 xmoden ymoden ? ? bwm<3:0> ywm<3:0> xwm<3:0> 0000 xmodsrt 0048 xmodsrt<15:0> ? 0000 xmodend 004a xmodend<15:0> ? 0001 ymodsrt 004c ymodsrt<15:0> ? 0000 ymodend 004e ymodend<15:0> ? 0001 xbrev 0050 bren xbrev<14:0> 0000 disicnt 0052 ? ? disicnt<13:0> 0000 tblpag 0054 ? ? ? ? ? ? ? ? tblpag<7:0> 0000 mstrpr 0058 mstrpr<15:0> 0000 table 4-1: cpu core register map fo r dspic33epxxxmc20x/50x and DSPIC33EPXXXGP50X devices only (continued) file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
DSPIC33EPXXXGP50X, dspic33epxxxm c20x/50x, and pi c24epxxxgp/mc20x ds70657d-page 58 preliminary ? 2011 microchip technology inc. table 4-2: cpu core register ma p for pic24epxxxgp/mc20x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets w0 0000 w0 (wreg) xxxx w1 0002 w1 xxxx w2 0004 w2 xxxx w3 0006 w3 xxxx w4 0008 w4 xxxx w5 000a w5 xxxx w6 000c w6 xxxx w7 000e w7 xxxx w8 0010 w8 xxxx w9 0012 w9 xxxx w10 0014 w10 xxxx w11 0016 w11 xxxx w12 0018 w12 xxxx w13 001a w13 xxxx w14 001c w14 xxxx w15 001e w15 xxxx splim 0020 splim 0000 pcl 002e pcl ? 0000 pch 0030 ? ? ? ? ? ? ? ? ?pch 0000 dsrpag 0032 ? ? ? ? ? ?dsrpag 0001 dswpag 0034 ? ? ? ? ? ? ?dswpag 0001 rcount 0036 rcount 0000 sr 0042 ? ? ? ? ? ? ? dc ipl2 ipl1 ipl0 ra n ov z c 0000 corcon 0044 var ? ? ? ? ? ? ? ? ? ? ? ipl3 sfa ? ? 0020 disicnt 0052 ? ? disicnt<13:0> 0000 tblpag 0054 ? ? ? ? ? ? ? ? tblpag<7:0> 0000 mstrpr 0058 mstrpr<15:0> 0000 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011 microchip technology inc. preliminary ds70657d-page 59 DSPIC33EPXXXGP50X, dspi c33epxxxmc20x/50x, and pic24epxxxgp/mc20x table 4-3: interrupt controller register map for pic24epxxxgp20x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets ifs0 0800 ? dma1if ad1if u1txif u1rxif spi1if spi1eif t3if t2if oc2if ic2if dma0if t1if oc1if ic1if int0if 0000 ifs1 0802 u2txif u2rxif int2if t5if t4if oc4if oc3if dma2if ? ? ? int1if cnif cmif mi2c1if si2c1if 0000 ifs2 0804 ? ? ? ? ? ? ? ? ? ic4if ic3if dma3if ? ?spi2ifspi2eif 0000 ifs3 0806 ? ? ? ? ? ? ? ? ? ? ? ? ? mi2c2if si2c2if ? 0000 ifs4 0808 ? ?ctmuif ? ? ? ? ? ? ? ? ? crcif u2eif u1eif ? 0000 ifs8 0810 jtagif icdif ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 ifs9 0812 ? ? ? ? ? ? ? ? ? ptg3if ptg2if ptg1if ptg0if ptgwdtif ptgstepif ? 0000 iec0 0820 ? dma1ie ad1ie u1txie u1rxie spi1ie spi1eie t3ie t2ie oc2ie ic2ie dma0ie t1ie oc1ie ic1ie int0ie 0000 iec1 0822 u2txie u2rxie int2ie t5ie t4ie oc4ie oc3ie dma2ie ? ? ? int1ie cnie cmie mi2c1ie si2c1ie 0000 iec2 0824 ? ? ? ? ? ? ? ? ? ic4ie ic3ie dma3ie ? ? spi2ie spi2eie 0000 iec3 0826 ? ? ? ? ? ? ? ? ? ? ? ? ? mi2c2ie si2c2ie ? 0000 iec4 0828 ? ?ctmuie ? ? ? ? ? ? ? ? ? crcie u2eie u1eie ? 0000 iec8 0830 jtagie icdie ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 iec9 0832 ? ? ? ? ? ? ? ? ? ptg3ie ptg2ie ptg1ie ptg0ie ptgwdtie ptgstepie ? 0000 ipc0 0840 ? t1ip<2:0> ?oc1ip<2:0> ? ic1ip<2:0> ? int0ip<2:0> 4444 ipc1 0842 ? t2ip<2:0> ?oc2ip<2:0> ? ic2ip<2:0> ? dma0ip<2:0> 4444 ipc2 0844 ? u1rxip<2:0> ? spi1ip<2:0> ?spi1eip<2:0> ? t3ip<2:0> 4444 ipc3 0846 ? ? ? ? ? dma1ip<2:0> ?ad1ip<2:0> ? u1txip<2:0> 0444 ipc4 0848 ? cnip<2:0> ?cmip<2:0> ? mi2c1ip<2:0> ? si2c1ip<2:0> 4444 ipc5 084a ? ? ? ? ? ? ? ? ? ? ? ? ? int1ip<2:0> 0004 ipc6 084c ? t4ip<2:0> ?oc4ip<2:0> ? oc3ip<2:0> ? dma2ip<2:0> 4444 ipc7 084e ? u2txip<2:0> ? u2rxip<2:0> ? int2ip<2:0> ? t5ip<2:0> 4444 ipc8 0850 ? ? ? ? ? ? ? ? ? spi2ip<2:0> ? spi2eip<2:0> 0044 ipc9 0852 ? ? ? ? ? ic4ip<2:0> ? ic3ip<2:0> ? dma3ip<2:0> 0444 ipc12 0858 ? ? ? ? ? mi2c2ip<2:0> ? si2c2ip<2:0> ? ? ? ? 0440 ipc16 0860 ? crcip<2:0> ? u2eip<2:0> ?u1eip<2:0> ? ? ? ? 4440 ipc19 0866 ? ? ? ? ? ? ? ? ?ctmuip<2:0> ? ? ? ? 0040 ipc35 0886 ? jtagid<2:0> ? icdip<2:0> ? ? ? ? ? ? ? ? 4400 ipc36 0888 ? ptg0ip<2:0> ? pgwdtip<2:0> ? ptgstepip<2:0> ? ? ? ? 4440 ipc37 088a ? ? ? ? ? ptg3ip<2:0> ? ptg2ip<2:0> ? ptg1ip<2:0> 0444 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
DSPIC33EPXXXGP50X, dspic33epxxxm c20x/50x, and pi c24epxxxgp/mc20x ds70657d-page 60 preliminary ? 2011 microchip technology inc. intcon1 08c0 nstdis ovaerr ovberr ? ? ? ? ? ? div0err dmacerr matherr addrerr stkerr oscfail ? 0000 intcon2 08c2 gie disi swtrap ? ? ? ? ? ? ? ? ? ? int2ep int1ep int0ep 8000 intcon3 08c4 ? ? ? ? ? ? ? ? ? ?daedoovr ? ? ? ? 0000 intcon4 08c6 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?sght 0000 inttreg 08c8 ? ? ? ? ilr<3:0> vecnum<7:0> 0000 table 4-3: interrupt controller register map for pic24epxxxgp20x devi ces only (continued) file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011 microchip technology inc. preliminary ds70657d-page 61 DSPIC33EPXXXGP50X, dspi c33epxxxmc20x/50x, and pic24epxxxgp/mc20x table 4-4: interrupt controller register map for pic24epxxxmc20x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets ifs0 0800 ? dma1if ad1if u1txif u1rxif spi1if spi1eif t3if t2if oc2if ic2if dma0if t1if oc1if ic1if int0if 0000 ifs1 0802 u2txif u2rxif int2if t5if t4if oc4if oc3if dma2if ? ? ? int1if cnif cmif mi2c1if si2c1if 0000 ifs2 0804 ? ? ? ? ? ? ? ? ? ic4if ic3if dma3if ? ?spi2ifspi2eif 0000 ifs3 0806 ? ? ? ? ? qei1if psemif ? ? ? ? ? ? mi2c2if si2c2if ? 0000 ifs4 0808 ? ?ctmuif ? ? ? ? ? ? ? ? ? crcif u2eif u1eif ? 0000 ifs5 080a pwm2if pwm1if ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 ifs6 080c ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?pwm3if 0000 ifs8 0810 jtagif icdif ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 ifs9 0812 ? ? ? ? ? ? ? ? ? ptg3if ptg2if ptg1if ptg0if ptgwdtif ptgstepif ? 0000 iec0 0820 ? dma1ie ad1ie u1txie u1rxie spi1ie spi1eie t3ie t2ie oc2ie ic2ie dma0ie t1ie oc1ie ic1ie int0ie 0000 iec1 0822 u2txie u2rxie int2ie t5ie t4ie oc4ie oc3ie dma2ie ? ? ? int1ie cnie cmie mi2c1ie si2c1ie 0000 iec2 0824 ? ? ? ? ? ? ? ? ? ic4ie ic3ie dma3ie ? ? spi2ie spi2eie 0000 iec3 0826 ? ? ? ? ? qei1ie psemie ? ? ? ? ? ? mi2c2ie si2c2ie ? 0000 iec4 0828 ? ?ctmuie ? ? ? ? ? ? ? ? ? crcie u2eie u1eie ? 0000 iec5 082a pwm2ie pwm1ie ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 iec6 082c ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?pwm3ie 0000 iec8 0830 jtagie icdie ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 iec9 0832 ? ? ? ? ? ? ? ? ? ptg3ie ptg2ie ptg1ie ptg0ie ptgwdtie ptgstepie ? 0000 ipc0 0840 ? t1ip<2:0> ?oc1ip<2:0> ? ic1ip<2:0> ? int0ip<2:0> 4444 ipc1 0842 ? t2ip<2:0> ?oc2ip<2:0> ? ic2ip<2:0> ? dma0ip<2:0> 4444 ipc2 0844 ? u1rxip<2:0> ? spi1ip<2:0> ?spi1eip<2:0> ? t3ip<2:0> 4444 ipc3 0846 ? ? ? ? ? dma1ip<2:0> ?ad1ip<2:0> ? u1txip<2:0> 0444 ipc4 0848 ? cnip<2:0> ?cmip<2:0> ? mi2c1ip<2:0> ? si2c1ip<2:0> 4444 ipc5 084a ? ? ? ? ? ? ? ? ? ? ? ? ? int1ip<2:0> 0004 ipc6 084c ? t4ip<2:0> ?oc4ip<2:0> ? oc3ip<2:0> ? dma2ip<2:0> 4444 ipc7 084e ? u2txip<2:0> ? u2rxip<2:0> ? int2ip<2:0> ? t5ip<2:0> 4444 ipc8 0850 ? ? ? ? ? ? ? ? ? spi2ip<2:0> ? spi2eip<2:0> 0044 ipc9 0852 ? ? ? ? ? ic4ip<2:0> ? ic3ip<2:0> ? dma3ip<2:0> 0444 ipc12 0858 ? ? ? ? ? mi2c2ip<2:0> ? si2c2ip<2:0> ? ? ? ? 0440 ipc14 085c ? ? ? ? ? qei1ip<2:0> ? psemip<2:0> ? ? ? ? 0440 ipc16 0860 ? crcip<2:0> ? u2eip<2:0> ?u1eip<2:0> ? ? ? ? 4440 ipc19 0866 ? ? ? ? ? ? ? ? ?ctmuip<2:0> ? ? ? ? 0040 ipc23 086e ? pwm2ip<2:0> ? pwm1ip<2:0> ? ? ? ? ? ? ? ? 4400 ipc24 0870 ? ? ? ? ? ? ? ? ? ? ? ? ? pwm3ip<2:0> 4004 ipc35 0886 ? jtagid<2:0> ? icdip<2:0> ? ? ? ? ? ? ? ? 4400 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
DSPIC33EPXXXGP50X, dspic33epxxxm c20x/50x, and pi c24epxxxgp/mc20x ds70657d-page 62 preliminary ? 2011 microchip technology inc. ipc36 0888 ? ptg0ip<2:0> ? pgwdtip<2:0> ? ptgstepip<2:0> ? ? ? ? 4440 ipc37 088a ? ? ? ? ? ptg3ip<2:0> ? ptg2ip<2:0> ? ptg1ip<2:0> 0444 intcon1 08c0 nstdis ovaerr ovberr ? ? ? ? ? ? div0err dmacerr matherr addrerr stkerr oscfail ? 0000 intcon2 08c2 gie disi swtrap ? ? ? ? ? ? ? ? ? ? int2ep int1ep int0ep 8000 intcon3 08c4 ? ? ? ? ? ? ? ? ? ?daedoovr ? ? ? ? 0000 intcon4 08c6 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?sght 0000 inttreg 08c8 ? ? ? ? ilr<3:0> vecnum<7:0> 0000 table 4-4: interrupt controller register map for pic24epxxxmc20x devices only (continued) file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011 microchip technology inc. preliminary ds70657d-page 63 DSPIC33EPXXXGP50X, dspi c33epxxxmc20x/50x, and pic24epxxxgp/mc20x table 4-5: interrupt controller register map for DSPIC33EPXXXGP50X devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets ifs0 0800 ? dma1if ad1if u1txif u1rxif spi1if spi1eif t3if t2if oc2if ic2if dma0if t1if oc1if ic1if int0if 0000 ifs1 0802 u2txif u2rxif int2if t5if t4if oc4if oc3if dma2if ? ? ? int1if cnif cmif mi2c1if si2c1if 0000 ifs2 0804 ? ? ? ? ? ? ? ? ? ic4if ic3if dma3if c1if c1rxif spi2if spi2eif 0000 ifs3 0806 ? ? ? ? ? ? ? ? ? ? ? ? ? mi2c2if si2c2if ? 0000 ifs4 0808 ? ?ctmuif ? ? ? ? ? ?c1txif ? ? crcif u2eif u1eif ? 0000 ifs6 080c ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?pwm3if 0000 ifs8 0810 jtagif icdif ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 ifs9 0812 ? ? ? ? ? ? ? ? ? ptg3if ptg2if ptg1if ptg0if ptgwdtif ptgstepif ? 0000 iec0 0820 ? dma1ie ad1ie u1txie u1rxie spi1ie spi1eie t3ie t2ie oc2ie ic2ie dma0ie t1ie oc1ie ic1ie int0ie 0000 iec1 0822 u2txie u2rxie int2ie t5ie t4ie oc4ie oc3ie dma2ie ? ? ? int1ie cnie cmie mi2c1ie si2c1ie 0000 iec2 0824 ? ? ? ? ? ? ? ? ? ic4ie ic3ie dma3ie c1ie c1rxie spi2ie spi2eie 0000 iec3 0826 ? ? ? ? ? ? ? ? ? ? ? ? ? mi2c2ie si2c2ie ? 0000 iec4 0828 ? ?ctmuie ? ? ? ? ? ?c1txie ? ? crcie u2eie u1eie ? 0000 iec8 0830 jtagie icdie ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 iec9 0832 ? ? ? ? ? ? ? ? ? ptg3ie ptg2ie ptg1ie ptg0ie ptgwdtie ptgstepie ? 0000 ipc0 0840 ? t1ip<2:0> ?oc1ip<2:0> ? ic1ip<2:0> ? int0ip<2:0> 4444 ipc1 0842 ? t2ip<2:0> ?oc2ip<2:0> ? ic2ip<2:0> ? dma0ip<2:0> 4444 ipc2 0844 ? u1rxip<2:0> ? spi1ip<2:0> ?spi1eip<2:0> ? t3ip<2:0> 4444 ipc3 0846 ? ? ? ? ? dma1ip<2:0> ?ad1ip<2:0> ? u1txip<2:0> 0444 ipc4 0848 ? cnip<2:0> ?cmip<2:0> ? mi2c1ip<2:0> ? si2c1ip<2:0> 4444 ipc5 084a ? ? ? ? ? ? ? ? ? ? ? ? ? int1ip<2:0> 0004 ipc6 084c ? t4ip<2:0> ?oc4ip<2:0> ? oc3ip<2:0> ? dma2ip<2:0> 4444 ipc7 084e ? u2txip<2:0> ? u2rxip<2:0> ? int2ip<2:0> ? t5ip<2:0> 4444 ipc8 0850 ? c1ip<2:0> ? c1rxip<2:0> ? spi2ip<2:0> ? spi2eip<2:0> 4444 ipc9 0852 ? ? ? ? ? ic4ip<2:0> ? ic3ip<2:0> ? dma3ip<2:0> 0444 ipc11 0856 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 ipc12 0858 ? ? ? ? ? mi2c2ip<2:0> ? si2c2ip<2:0> ? ? ? ? 0440 ipc16 0860 ? crcip<2:0> ? u2eip<2:0> ?u1eip<2:0> ? ? ? ? 4440 ipc17 0862 ? ? ? ? ? c1txip<2:0> ? ? ? ? ? ? ? ? 0400 ipc19 0866 ? ? ? ? ? ? ? ? ?ctmuip<2:0> ? ? ? ? 0040 ipc35 0886 ? jtagid<2:0> ? icdip<2:0> ? ? ? ? ? ? ? ? 4400 ipc36 0888 ? ptg0ip<2:0> ? pgwdtip<2:0> ? ptgstepip<2:0> ? ? ? ? 4440 ipc37 088a ? ? ? ? ? ptg3ip<2:0> ? ptg2ip<2:0> ? ptg1ip<2:0> 0444 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
DSPIC33EPXXXGP50X, dspic33epxxxm c20x/50x, and pi c24epxxxgp/mc20x ds70657d-page 64 preliminary ? 2011 microchip technology inc. intcon1 08c0 nstdis ovaerr ovberr covaerr covberr ovate ovbte co vte sftacerr div0err dmacerr matherr addrerr stkerr oscfail ? 0000 intcon2 08c2 gie disi swtrap ? ? ? ? ? ? ? ? ? ? int2ep int1ep int0ep 8000 intcon3 08c4 ? ? ? ? ? ? ? ? ? ?daedoovr ? ? ? ? 0000 intcon4 08c6 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?sght 0000 inttreg 08c8 ? ? ? ? ilr<3:0> vecnum<7:0> 0000 table 4-5: interrupt controller register map fo r DSPIC33EPXXXGP50X devices only (continued) file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011 microchip technology inc. preliminary ds70657d-page 65 DSPIC33EPXXXGP50X, dspi c33epxxxmc20x/50x, and pic24epxxxgp/mc20x table 4-6: interrupt controller register map for dspic33epxxxmc20x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets ifs0 0800 ? dma1if ad1if u1txif u1rxif spi1if spi1eif t3if t2if oc2if ic2if dma0if t1if oc1if ic1if int0if 0000 ifs1 0802 u2txif u2rxif int2if t5if t4if oc4if oc3if dma2if ? ? ? int1if cnif cmif mi2c1if si2c1if 0000 ifs2 0804 ? ? ? ? ? ? ? ? ? ic4if ic3if dma3if ? ?spi2ifspi2eif 0000 ifs3 0806 ? ? ? ? ? qei1if psemif ? ? ? ? ? ? mi2c2if si2c2if ? 0000 ifs4 0808 ? ?ctmuif ? ? ? ? ? ? ? ? ? crcif u2eif u1eif ? 0000 ifs5 080a pwm2if pwm1if ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 ifs6 080c ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?pwm3if 0000 ifs8 0810 jtagif icdif ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 ifs9 0812 ? ? ? ? ? ? ? ? ? ptg3if ptg2if ptg1if ptg0if ptgwdtif ptgstepif ? 0000 iec0 0820 ? dma1ie ad1ie u1txie u1rxie spi1ie spi1eie t3ie t2ie oc2ie ic2ie dma0ie t1ie oc1ie ic1ie int0ie 0000 iec1 0822 u2txie u2rxie int2ie t5ie t4ie oc4ie oc3ie dma2ie ? ? ? int1ie cnie cmie mi2c1ie si2c1ie 0000 iec2 0824 ? ? ? ? ? ? ? ? ? ic4ie ic3ie dma3ie ? ? spi2ie spi2eie 0000 iec3 0826 ? ? ? ? ? qei1ie psemie ? ? ? ? ? ? mi2c2ie si2c2ie ? 0000 iec4 0828 ? ?ctmuie ? ? ? ? ? ? ? ? ? crcie u2eie u1eie ? 0000 iec5 082a pwm2ie pwm1ie ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 iec6 082c ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?pwm3ie 0000 iec8 0830 jtagie icdie ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 iec9 0832 ? ? ? ? ? ? ? ? ? ptg3ie ptg2ie ptg1ie ptg0ie ptgwdtie ptgstepie ? 0000 ipc0 0840 ? t1ip<2:0> ?oc1ip<2:0> ? ic1ip<2:0> ? int0ip<2:0> 4444 ipc1 0842 ? t2ip<2:0> ?oc2ip<2:0> ? ic2ip<2:0> ? dma0ip<2:0> 4444 ipc2 0844 ? u1rxip<2:0> ? spi1ip<2:0> ?spi1eip<2:0> ? t3ip<2:0> 4444 ipc3 0846 ? ? ? ? ? dma1ip<2:0> ?ad1ip<2:0> ? u1txip<2:0> 0444 ipc4 0848 ? cnip<2:0> ?cmip<2:0> ? mi2c1ip<2:0> ? si2c1ip<2:0> 4444 ipc5 084a ? ? ? ? ? ? ? ? ? ? ? ? ? int1ip<2:0> 0004 ipc6 084c ? t4ip<2:0> ?oc4ip<2:0> ? oc3ip<2:0> ? dma2ip<2:0> 4444 ipc7 084e ? u2txip<2:0> ? u2rxip<2:0> ? int2ip<2:0> ? t5ip<2:0> 4444 ipc8 0850 ? ? ? ? ? c1rxip<2:0> ? spi2ip<2:0> ? spi2eip<2:0> 0444 ipc9 0852 ? ? ? ? ? ic4ip<2:0> ? ic3ip<2:0> ? dma3ip<2:0> 0444 ipc12 0858 ? ? ? ? ? mi2c2ip<2:0> ? si2c2ip<2:0> ? ? ? ? 0440 ipc14 085c ? ? ? ? ? qei1ip<2:0> ? psemip<2:0> ? ? ? ? 0440 ipc16 0860 ? crcip<2:0> ? u2eip<2:0> ?u1eip<2:0> ? ? ? ? 4440 ipc19 0866 ? ? ? ? ? ? ? ? ?ctmuip<2:0> ? ? ? ? 0040 ipc23 086e ? pwm2ip<2:0> ? pwm1ip<2:0> ? ? ? ? ? ? ? ? 4400 ipc24 0870 ? ? ? ? ? ? ? ? ? ? ? ? ? pwm3ip<2:0> 0004 ipc35 0886 ? jtagid<2:0> ? icdip<2:0> ? ? ? ? ? ? ? ? 4400 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
DSPIC33EPXXXGP50X, dspic33epxxxm c20x/50x, and pi c24epxxxgp/mc20x ds70657d-page 66 preliminary ? 2011 microchip technology inc. ipc36 0888 ? ptg0ip<2:0> ? pgwdtip<2:0> ? ptgstepip<2:0> ? ? ? ? 4440 ipc37 088a ? ? ? ? ? ptg3ip<2:0> ? ptg2ip<2:0> ? ptg1ip<2:0> 0444 intcon1 08c0 nstdis ovaerr ovberr covaerr covberr ovate ovbte co vte sftacerr div0err dmacerr matherr addrerr stkerr oscfail ? 0000 intcon2 08c2 gie disi swtrap ? ? ? ? ? ? ? ? ? ? int2ep int1ep int0ep 8000 intcon3 08c4 ? ? ? ? ? ? ? ? ? ?daedoovr ? ? ? ? 0000 intcon4 08c6 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?sght 0000 inttreg 08c8 ? ? ? ? ilr<3:0> vecnum<7:0> 0000 table 4-6: interrupt controller register map for dspic33epxxxmc20x d evices only (continued) file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011 microchip technology inc. preliminary ds70657d-page 67 DSPIC33EPXXXGP50X, dspi c33epxxxmc20x/50x, and pic24epxxxgp/mc20x table 4-7: interrupt controller register map for dspic33epxxxmc50x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets ifs0 0800 ? dma1if ad1if u1txif u1rxif spi1if spi1eif t3if t2if oc2if ic2if dma0if t1if oc1if ic1if int0if 0000 ifs1 0802 u2txif u2rxif int2if t5if t4if oc4if oc3if dma2if ? ? ? int1if cnif cmif mi2c1if si2c1if 0000 ifs2 0804 ? ? ? ? ? ? ? ? ? ic4if ic3if dma3if c1if c1rxif spi2if spi2eif 0000 ifs3 0806 ? ? ? ? ? qei1if psemif ? ? ? ? ? ? mi2c2if si2c2if ? 0000 ifs4 0808 ? ?ctmuif ? ? ? ? ? ?c1txif ? ? crcif u2eif u1eif ? 0000 ifs5 080a pwm2if pwm1if ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 ifs6 080c ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?pwm3if 0000 ifs8 0810 jtagif icdif ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 ifs9 0812 ? ? ? ? ? ? ? ? ? ptg3if ptg2if ptg1if ptg0if ptgwdtif ptgstepif ? 0000 iec0 0820 ? dma1ie ad1ie u1txie u1rxie spi1ie spi1eie t3ie t2ie oc2ie ic2ie dma0ie t1ie oc1ie ic1ie int0ie 0000 iec1 0822 u2txie u2rxie int2ie t5ie t4ie oc4ie oc3ie dma2ie ? ? ? int1ie cnie cmie mi2c1ie si2c1ie 0000 iec2 0824 ? ? ? ? ? ? ? ? ? ic4ie ic3ie dma3ie c1ie c1rxie spi2ie spi2eie 0000 iec3 0826 ? ? ? ? ? qei1ie psemie ? ? ? ? ? ? mi2c2ie si2c2ie ? 0000 iec4 0828 ? ?ctmuie ? ? ? ? ? ?c1txie ? ? crcie u2eie u1eie ? 0000 iec5 082a pwm2ie pwm1ie ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 iec6 082c ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?pwm3ie 0000 iec7 082e ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 iec8 0830 jtagie icdie ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 iec9 0832 ? ? ? ? ? ? ? ? ? ptg3ie ptg2ie ptg1ie ptg0ie ptgwdtie ptgstepie ? 0000 ipc0 0840 ? t1ip<2:0> ?oc1ip<2:0> ? ic1ip<2:0> ? int0ip<2:0> 4444 ipc1 0842 ? t2ip<2:0> ?oc2ip<2:0> ? ic2ip<2:0> ? dma0ip<2:0> 4444 ipc2 0844 ? u1rxip<2:0> ? spi1ip<2:0> ?spi1eip<2:0> ? t3ip<2:0> 4444 ipc3 0846 ? ? ? ? ? dma1ip<2:0> ?ad1ip<2:0> ? u1txip<2:0> 0444 ipc4 0848 ? cnip<2:0> ?cmip<2:0> ? mi2c1ip<2:0> ? si2c1ip<2:0> 4444 ipc5 084a ? ? ? ? ? ? ? ? ? ? ? ? ? int1ip<2:0> 0004 ipc6 084c ? t4ip<2:0> ?oc4ip<2:0> ? oc3ip<2:0> ? dma2ip<2:0> 4444 ipc7 084e ? u2txip<2:0> ? u2rxip<2:0> ? int2ip<2:0> ? t5ip<2:0> 4444 ipc8 0850 ? c1ip<2:0> ? c1rxip<2:0> ? spi2ip<2:0> ? spi2eip<2:0> 4444 ipc9 0852 ? ? ? ? ? ic4ip<2:0> ? ic3ip<2:0> ? dma3ip<2:0> 0444 ipc12 0858 ? ? ? ? ? mi2c2ip<2:0> ? si2c2ip<2:0> ? ? ? ? 0440 ipc14 085c ? ? ? ? ? qei1ip<2:0> ? psemip<2:0> ? ? ? ? 0440 ipc16 0860 ? crcip<2:0> ? u2eip<2:0> ?u1eip<2:0> ? ? ? ? 4440 ipc17 0862 ? ? ? ? ? c1txip<2:0> ? ? ? ? ? ? ? ? 0400 ipc19 0866 ? ? ? ? ? ? ? ? ?ctmuip<2:0> ? ? ? ? 0040 ipc23 086e ? pwm2ip<2:0> ? pwm1ip<2:0> ? ? ? ? ? ? ? ? 4400 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
DSPIC33EPXXXGP50X, dspic33epxxxm c20x/50x, and pi c24epxxxgp/mc20x ds70657d-page 68 preliminary ? 2011 microchip technology inc. ipc24 0870 ? ? ? ? ? ? ? ? ? ? ? ? ? pwm3ip<2:0> 0004 ipc35 0886 ? jtagid<2:0> ? icdip<2:0> ? ? ? ? ? ? ? ? 4400 ipc36 0888 ? ptg0ip<2:0> ? pgwdtip<2:0> ? ptgstepip<2:0> ? ? ? ? 4440 ipc37 088a ? ? ? ? ? ptg3ip<2:0> ? ptg2ip<2:0> ? ptg1ip<2:0> 0444 intcon1 08c0 nstdis ovaerr ovberr covaerr covberr ovate ovbte co vte sftacerr div0err dmacerr matherr addrerr stkerr oscfail ? 0000 intcon2 08c2 gie disi swtrap ? ? ? ? ? ? ? ? ? ? int2ep int1ep int0ep 8000 intcon3 08c4 ? ? ? ? ? ? ? ? ? ?daedoovr ? ? ? ? 0000 intcon4 08c6 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?sght 0000 inttreg 08c8 ? ? ? ? ilr<3:0> vecnum<7:0> 0000 table 4-7: interrupt controller register map for dspic33epxxxmc50x d evices only (continued) file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011 microchip technology inc. preliminary ds70657d-page 69 DSPIC33EPXXXGP50X, dspi c33epxxxmc20x/50x, and pic24epxxxgp/mc20x table 4-8: timer1 through timer5 register map sfr name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets tmr1 0100 timer1 register xxxx pr1 0102 period register 1 ffff t1con 0104 ton ?tsidl ? ? ? ? ? ? tgate tckps<1:0> ?tsynctcs ? 0000 tmr2 0106 timer2 register xxxx tmr3hld 0108 timer3 holding register (for 32-bit timer operations only) xxxx tmr3 010a timer3 register xxxx pr2 010c period register 2 ffff pr3 010e period register 3 ffff t2con 0110 ton ?tsidl ? ? ? ? ? ? tgate tckps<1:0> t32 ?tcs ? 0000 t3con 0112 ton ?tsidl ? ? ? ? ? ? tgate tckps<1:0> ? ?tcs ? 0000 tmr4 0114 timer4 register xxxx tmr5hld 0116 timer5 holding register (for 32-bit operations only) xxxx tmr5 0118 timer5 register xxxx pr4 011a period register 4 ffff pr5 011c period register 5 ffff t4con 011e ton ?tsidl ? ? ? ? ? ? tgate tckps<1:0> t32 ?tcs ? 0000 t5con 0120 ton ?tsidl ? ? ? ? ? ? tgate tckps<1:0> ? ?tcs ? 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
DSPIC33EPXXXGP50X, dspic33epxxxm c20x/50x, and pi c24epxxxgp/mc20x ds70657d-page 70 preliminary ? 2011 microchip technology inc. table 4-9: input capture 1 through input capture 4 register map file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets ic1con1 0140 ? ? icsidl ictsel<2:0> ? ? ? ici<1:0> icov icbne icm<2:0> 0000 ic1con2 0142 ? ? ? ? ? ? ? ic32 ictrig trigstat ? syncsel<4:0> 000d ic1buf 0144 input capture 1 buffer register xxxx ic1tmr 0146 input capture 1 timer 0000 ic2con1 0148 ? ? icsidl ictsel<2:0> ? ? ? ici<1:0> icov icbne icm<2:0> 0000 ic2con2 014a ? ? ? ? ? ? ? ic32 ictrig trigstat ? syncsel<4:0> 000d ic2buf 014c input capture 2 buffer register xxxx ic2tmr 014e input capture 2 timer 0000 ic3con1 0150 ? ? icsidl ictsel<2:0> ? ? ? ici<1:0> icov icbne icm<2:0> 0000 ic3con2 0152 ? ? ? ? ? ? ? ic32 ictrig trigstat ? syncsel<4:0> 000d ic3buf 0154 input capture 3 buffer register xxxx ic3tmr 0156 input capture 3 timer 0000 ic4con1 0158 ? ? icsidl ictsel<2:0> ? ? ? ici<1:0> icov icbne icm<2:0> 0000 ic4con2 015a ? ? ? ? ? ? ? ic32 ictrig trigstat ? syncsel<4:0> 000d ic4buf 015c input capture 4 buffer register xxxx ic4tmr 015e input capture 4 timer 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011 microchip technology inc. preliminary ds70657d-page 71 DSPIC33EPXXXGP50X, dspi c33epxxxmc20x/50x, and pic24epxxxgp/mc20x table 4-10: output compare 1 through output compare 4 register map file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets oc1con1 0900 ? ? ocsidl octsel<2:0> ? enfltb enflta ? ocfltb ocflta trigmode ocm<2:0> 0000 oc1con2 0902 fltmd fltout flttrien ocinv ? ? ? oc32 octrig trigstat octris syncsel<4:0> 000c oc1rs 0904 output compare 1 secondary register xxxx oc1r 0906 output compare 1 register xxxx oc1tmr 0908 timer value 1 register xxxx oc2con1 090a ? ? ocsidl octsel<2:0> ? enfltb enflta ? ocfltb ocflta trigmode ocm<2:0> 0000 oc2con2 090c fltmd fltout flttrien ocinv ? ? ? oc32 octrig trigstat octris syncsel<4:0> 000c oc2rs 090e output compare 2 secondary register xxxx oc2r 0910 output compare 2 register xxxx oc2tmr 0912 timer value 2 register xxxx oc3con1 0914 ? ? ocsidl octsel<2:0> ? enfltb enflta ? ocfltb ocflta trigmode ocm<2:0> 0000 oc3con2 0916 fltmd fltout flttrien ocinv ? ? ? oc32 octrig trigstat octris syncsel<4:0> 000c oc3rs 0918 output compare 3 secondary register xxxx oc3r 091a output compare 3 register xxxx oc3tmr 091c timer value 3 register xxxx oc4con1 091e ? ? ocsidl octsel<2:0> enfltc enfltb enflta ocfltc ocfltb ocflta trigmode ocm<2:0> 0000 oc4con2 0920 fltmd fltout flttrien ocinv ? ? ? oc32 octrig trigstat octris syncsel<4:0> 000c oc4rs 0922 output compare 4 secondary register xxxx oc4r 0924 output compare 4 register xxxx oc4tmr 0926 timer value 4 register xxxx legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
DSPIC33EPXXXGP50X, dspic33epxxxm c20x/50x, and pi c24epxxxgp/mc20x ds70657d-page 72 preliminary ? 2011 microchip technology inc. table 4-11: ptg register map file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets ptgcst 0ac0 ptgen ? ptgsidl ptgtogl ?ptgswt ? ptgivis ptgstrt ptgwto ? ? ? ?ptgitm<1:0> 0000 ptgcon 0ac2 ptgclk<2:0> ptgdiv<4:0> ptgpwd<3:0> ?ptgwdt<2:0> 0000 ptgbte 0ac4 ptgbte<15:0> 0000 ptghold 0ac6 ptghold<15:0> 0000 ptgt0lim 0ac8 ptgt0lim<15:0> 0000 ptgt1lim 0aca ptgt1lim<15:0> 0000 ptgsdlim 0acc ptgsdlim<15:0> 0000 ptgc0lim 0ace ptgc0lim<15:0> 0000 ptgc1lim 0ad0 ptgc1lim<15:0> 0000 ptgadj 0ad2 ptgadj<15:0> 0000 ptgl0 0ad4 ptgl0<15:0> 0000 ptgqptr 0ad6 ? ? ? ? ? ? ? ? ? ? ? ptgqptr<4:0> 0000 ptgque0 0ad8 step1<7:0> step0<7:0> 0000 ptgque1 0ada step3<7:0> step2<7:0> 0000 ptgque2 0adc step5<7:0> step4<7:0> 0000 ptgque3 0ade step7<7:0> step6<7:0> 0000 ptgque4 0ae0 step9<7:0> step8<7:0> 0000 ptgque5 0ae2 step11<7:0> step10<7:0> 0000 ptgque6 0ae4 step13<7:0> step12<7:0> 0000 ptgque7 0ae6 step15<7:0> step14<7:0> 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011 microchip technology inc. preliminary ds70657d-page 73 DSPIC33EPXXXGP50X, dspi c33epxxxmc20x/50x, and pic24epxxxgp/mc20x table 4-12: pwm register map for dspic33epxxxm c20x/50x and pic24epxxxmc20x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets ptcon 0c00 pten ? ptsidl sestat seien eipu syncpol syncoen syncen syncsrc<2:0> sevtps<3:0> 0000 ptcon2 0c02 ? ? ? ? ? ? ? ? ? ? ? ? ? pclkdiv<2:0> 0000 ptper 0c04 ptper<15:0> 00f8 sevtcmp 0c06 sevtcmp<15:0> 0000 mdc 0c0a mdc<15:0> 0000 chop 0c1a chpclken ? ? ? ? ? chopclk<9:0> 0000 pwmkey 0c1e pwmkey<15:0> 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. table 4-13: pwm generator 1 register map for ds pic33epxxxmc20x/50x and pic24epxxxmc20x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets pwmcon1 0c20 fltstat clstat trgstat fltien clien trgien itb mdcs dtc<1:0> dtcp ? mtbs cam xpres iue 0000 iocon1 0c22 penh penl polh poll pmod<1:0> ovrenh ovre nl ovrdat<1:0> fltdat<1:0> cldat<1:0> swap osync 0000 fclcon1 0c24 ? clsrc<4:0> clpol clmod fltsrc<4:0> fltpol fltmod<1:0> 0000 pdc1 0c26 pdc1<15:0> fff8 phase1 0c28 phase1<15:0> 0000 dtr1 0c2a ? ? dtr1<13:0> 0000 altdtr1 0c2c ? ? altdtr1<13:0> 0000 trig1 0c32 trgcmp<15:0> 0000 trgcon1 0c34 trgdiv<3:0> ? ? ? ? ? ?trgstrt<5:0> 0000 lebcon1 0c3a phr phf plr plf fltleben clleben ? ? ? ? bch bcl bphh bphl bplh bpll 0000 lebdly1 0c3c ? ? ? ? leb<11:0> 0000 auxcon1 0c3e ? ? ? ? blanksel<3:0> ? ? chopclk<3:0> chophen choplen 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
DSPIC33EPXXXGP50X, dspic33epxxxm c20x/50x, and pi c24epxxxgp/mc20x ds70657d-page 74 preliminary ? 2011 microchip technology inc. table 4-14: pwm generator 2 register map for ds pic33epxxxmc20x/50x and pic24epxxxmc20x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets pwmcon2 0c40 fltstat clstat trgstat flt ien clien trgien itb mdcs dtc<1:0> dtcp ? mtbs cam xpres iue 0000 iocon2 0c42 penh penl polh poll pmod<1:0> ovrenh ovre nl ovrdat<1:0> fltdat<1:0> cldat<1:0> swap osync 0000 fclcon2 0c44 ? clsrc<4:0> clpol clmod fltsrc<4:0> fltpol fltmod<1:0> 00f8 pdc2 0c46 pdc2<15:0> 0000 phase2 0c48 phase2<15:0> 0000 dtr2 0c4a ? ? dtr2<13:0> 0000 altdtr2 0c4c ? ? altdtr2<13:0> 0000 trig2 0c52 trgcmp<15:0> 0000 trgcon2 0c54 trgdiv<3:0> ? ? ? ? ? ?trgstrt<5:0> 0000 lebcon2 0c5a phr phf plr plf fltleben clleben ? ? ? ? bch bcl bphh bphl bplh bpll 0000 lebdly2 0c5c ? ? ? ? leb<11:0> 0000 auxcon2 0c5e ? ? ? ? blanksel<3:0> ? ? chopsel<3:0> chophen choplen 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. table 4-15: pwm generator 3 register map for ds pic33epxxxmc20x/50x and pic24epxxxmc20x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets pwmcon3 0c60 fltstat clstat trgstat flt ien clien trgien itb mdcs dtc<1:0> dtcp ? mtbs cam xpres iue 0000 iocon3 0c62 penh penl polh poll pmod<1:0> ovrenh ovre nl ovrdat<1:0> fltdat<1:0> cldat<1:0> swap osync 0000 fclcon3 0c64 ? clsrc<4:0> clpol clmod fltsrc<4:0> fltpol fltmod<1:0> 00f8 pdc3 0c66 pdc3<15:0> 0000 phase3 0c68 phase3<15:0> 0000 dtr3 0c6a ? ? dtr3<13:0> 0000 altdtr3 0c6c ? ? altdtr3<13:0> 0000 trig3 0c72 trgcmp<15:0> 0000 trgcon3 0c74 trgdiv<3:0> ? ? ? ? ? ?trgstrt<5:0> 0000 lebcon3 0c7a phr phf plr plf fltleben clleben ? ? ? ? bch bcl bphh bphl bplh bpll 0000 lebdly3 0c7c ? ? ? ? leb<11:0> 0000 auxcon3 0c7e ? ? ? ? blanksel<3:0> ? ? chopsel<3:0> chophen choplen 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011 microchip technology inc. preliminary ds70657d-page 75 DSPIC33EPXXXGP50X, dspi c33epxxxmc20x/50x, and pic24epxxxgp/mc20x table 4-16: qei1 register map for dspic33epxxxm c20x/50x and pic24epxxxmc20x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets qei1con 01c0 qeien ? qeisidl pimod<2:0> imv<1:0> ? intdiv<2:0> cntpol gaten ccm<1:0> 0000 qei1ioc 01c2 qcapen fltren qfdiv<2:0> outfnc<1:0> swpab hompol idxpol qebpol qeapol home index qeb qea 000x qei1stat 01c4 ? ? pcheqirq pcheqien pcleqirq pcleqien posovirq posovien pciirq pciien velovirq velovien homirq homien idxirq idxien 0000 pos1cntl 01c6 poscnt<15:0> 0000 pos1cnth 01c8 poscnt<31:16> 0000 pos1hld 01ca poshld<15:0> 0000 vel1cnt 01cc velcnt<15:0> 0000 int1tmrl 01ce inttmr<15:0> 0000 int1tmrh 01d0 inttmr<31:16> 0000 int1hldl 01d2 inthld<15:0> 0000 int1hldh 01d4 inthld<31:16> 0000 indx1cntl 01d6 indxcnt<15:0> 0000 indx1cnth 01d8 indxcnt<31:16> 0000 indx1hld 01da indxhld<15:0> 0000 qei1gecl 01dc qeigec<15:0> 0000 qei1icl 01dc qeiic<15:0> 0000 qei1gech 01de qeigec<31:16> 0000 qei1ich 01de qeiic<31:16> 0000 qei1lecl 01e0 qeilec<15:0> 0000 qei1lech 01e2 qeilec<31:16> 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
DSPIC33EPXXXGP50X, dspic33epxxxm c20x/50x, and pi c24epxxxgp/mc20x ds70657d-page 76 preliminary ? 2011 microchip technology inc. table 4-17: i2c1 and i2c2 register map file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets i2c1rcv 0200 ? ? ? ? ? ? ? ? receive register 0000 i2c1trn 0202 ? ? ? ? ? ? ? ? transmit register 00ff i2c1brg 0204 ? ? ? ? ? ? ? baud rate generator 0000 i2c1con 0206 i2cen ? i2csidl sclrel ipmien a10m disslw smen gcen stren ackdt acken rcen pen rsen sen 1000 i2c1stat 0208 ackstat trstat ? ? ? bcl gcstat add10 iwcol i2cov d_a p s r_w rbf tbf 0000 i2c1add 020a ? ? ? ? ? ? address register 0000 i2c1msk 020c ? ? ? ? ? ? address mask 0000 i2c2rcv 0210 ? ? ? ? ? ? ? ? receive register 0000 i2c2trn 0212 ? ? ? ? ? ? ? ? transmit register 00ff i2c2brg 0214 ? ? ? ? ? ? ? baud rate generator 0000 i2c2con 0216 i2cen ? i2csidl sclrel ipmien a10m disslw smen gcen stren ackdt acken rcen pen rsen sen 1000 i2c2stat 0218 ackstat trstat ? ? ? bcl gcstat add10 iwcol i2cov d_a p s r_w rbf tbf 0000 i2c2add 021a ? ? ? ? ? ? address register 0000 i2c2msk 021c ? ? ? ? ? ? address mask 0000 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. table 4-18: uart1 and uart2 register map sfr name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets u1mode 0220 uarten ? usidl iren rtsmd ? uen<1:0> wake lpback abaud urxinv brgh pdsel<1:0> stsel 0000 u1sta 0222 utxisel1 utxinv utxisel0 ? utxbrk utxen utxbf trmt urxisel<1:0> adden ridle perr ferr oerr urxda 0110 u1txreg 0224 ? ? ? ? ? ? ? transmit register xxxx u1rxreg 0226 ? ? ? ? ? ? ? receive register 0000 u1brg 0228 baud rate generator prescaler 0000 u2mode 0230 uarten ? usidl iren rtsmd ? uen<1:0> wake lpback abaud urxinv brgh pdsel<1:0> stsel 0000 u2sta 0232 utxisel1 utxinv utxisel0 ? utxbrk utxen utxbf trmt urxisel<1:0> adden ridle perr ferr oerr urxda 0110 u2txreg 0234 ? ? ? ? ? ? ? transmit register xxxx u2rxreg 0236 ? ? ? ? ? ? ? receive register 0000 u2brg 0238 baud rate generator prescaler 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011 microchip technology inc. preliminary ds70657d-page 77 DSPIC33EPXXXGP50X, dspi c33epxxxmc20x/50x, and pic24epxxxgp/mc20x table 4-19: spi1 and spi2 register map sfr name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets spi1stat 0240 spien ? spisidl ? ? spibec<2:0> srmpt spirov srxmpt sisel<2:0> spitbf spirbf 0000 spi1con1 0242 ? ? ? dissck dissdo mode16 smp cke ssen ckp msten spre<2:0> ppre<1:0> 0000 spi1con2 0244 frmen spifsd frmpol ? ? ? ? ? ? ? ? ? ? ? frmdly spiben 0000 spi1buf 0248 spi1 transmit and receive buffer register 0000 spi2stat 0260 spien ? spisidl ? ? spibec<2:0> srmpt spirov srxmpt sisel<2:0> spitbf spirbf 0000 spi2con1 0262 ? ? ? dissck dissdo mode16 smp cke ssen ckp msten spre<2:0> ppre<1:0> 0000 spi2con2 0264 frmen spifsd frmpol ? ? ? ? ? ? ? ? ? ? ? frmdly spiben 0000 spi2buf 0268 spi2 transmit and receive buffer register 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
DSPIC33EPXXXGP50X, dspic33epxxxm c20x/50x, and pi c24epxxxgp/mc20x ds70657d-page 78 preliminary ? 2011 microchip technology inc. table 4-20: adc1 register map file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets adc1buf0 0300 adc1 data buffer 0 xxxx adc1buf1 0302 adc1 data buffer 1 xxxx adc1buf2 0304 adc1 data buffer 2 xxxx adc1buf3 0306 adc1 data buffer 3 xxxx adc1buf4 0308 adc1 data buffer 4 xxxx adc1buf5 030a adc1 data buffer 5 xxxx adc1buf6 030c adc1 data buffer 6 xxxx adc1buf7 030e adc1 data buffer 7 xxxx adc1buf8 0310 adc1 data buffer 8 xxxx adc1buf9 0312 adc1 data buffer 9 xxxx adc1bufa 0314 adc1 data buffer 10 xxxx adc1bufb 0316 adc1 data buffer 11 xxxx adc1bufc 0318 adc1 data buffer 12 xxxx adc1bufd 031a adc1 data buffer 13 xxxx adc1bufe 031c adc1 data buffer 14 xxxx adc1buff 031e adc1 data buffer 15 xxxx ad1con1 0320 adon ? adsidl addmabm ? ad12b form<1:0> ssrc<2:0> ssrcg simsam asam samp done 0000 ad1con2 0322 vcfg<2:0> ? ? cscna chps<1:0> bufs smpi<4:0> bufm alts 0000 ad1con3 0324 adrc ? ? samc<4:0> adcs<7:0> 0000 ad1chs123 0326 ? ? ? ? ? ch123nb<1:0> ch123sb ? ? ? ? ? ch123na<1:0> ch123sa 0000 ad1chs0 0328 ch0nb ? ? ch0sb<4:0> ch0na ? ? ch0sa<4:0> 0000 ad1cssh 032e css31 css30 ? ? ? css26 css25 css24 ? ? ? ? ? ? ? ? 0000 ad1cssl 0330 css15 css14 css13 css12 css11 css10 css9 css8 css7 css6 css5 css4 css3 css2 css1 css0 0000 ad1con4 0332 ? ? ? ? ? ? ? addmaen ? ? ? ? ?dmabl<2:0> 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011 microchip technology inc. preliminary ds70657d-page 79 DSPIC33EPXXXGP50X, dspi c33epxxxmc20x/50x, and pic24epxxxgp/mc20x table 4-21: ecan1 register ma p when win (c1ctrl<0>) = 0 or 1 for dspic33epxxxmc/gp50x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets c1ctrl1 0400 ? ? csidl abat cancks reqop<2:0> opmode<2:0> ? cancap ? ?win 0480 c1ctrl2 0402 ? ? ? ? ? ? ? ? ? ? ? dncnt<4:0> 0000 c1vec 0404 ? ? ?filhit<4:0> ? icode<6:0> 0040 c1fctrl 0406 dmabs<2:0> ? ? ? ? ? ? ? ?fsa<4:0> 0000 c1fifo 0408 ? ?fbp<5:0> ? ? fnrb<5:0> 0000 c1intf 040a ? ? txbo txbp rxbp txwar rxwar ewarn ivrif wakif errif ? fifoif rbovif rbif tbif 0000 c1inte 040c ? ? ? ? ? ? ? ? ivrie wakie errie ? fifoie rbovie rbie tbie 0000 c1ec 040e terrcnt<7:0> rerrcnt<7:0> 0000 c1cfg1 0410 ? ? ? ? ? ? ? ? sjw<1:0> brp<5:0> 0000 c1cfg2 0412 ?wakfil ? ? ? seg2ph<2:0> seg2phts sam seg1ph<2:0> prseg<2:0> 0000 c1fen1 0414 flten15 flten14 flten13 flten12 flten11 flten10 flte n9 flten8 flten7 flten6 flten5 fl ten4 flten3 flten2 flten1 flten0 ffff c1fmsksel1 0418 f7msk<1:0> f6msk<1:0> f5msk<1:0> f4msk<1:0> f3msk<1:0> f2msk<1:0> f1msk<1:0> f0msk<1:0> 0000 c1fmsksel2 041a f15msk<1:0> f14msk<1:0> f13msk<1:0> f12msk<1:0> f11msk<1:0> f10msk<1:0> f9msk<1:0> f8msk<1:0> 0000 legend: ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. table 4-22: ecan1 register ma p when win (c1ctrl<0>) = 0 for dspic33epxxxmc/gp50x devices only file name addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets 0400- 041e see definition when win = x c1rxful1 0420 rxful15 rxful14 rxful13 rxful12 rxful11 rxful10 rxful9 rxful8 rxful7 rxful6 rxful5 rxful4 rxful3 rxful2 rxful1 rxful0 0000 c1rxful2 0422 rxful31 rxful30 rxful29 rxful28 rxful27 rxful26 rxful25 rxful24 rxful23 rxful22 rxful21 rxful20 rxful19 rxful18 rxful17 rxful16 0000 c1rxovf1 0428 rxovf15 rxovf14 rxovf13 rxovf12 rxovf11 rxovf10 rxov f9 rxovf8 rxovf7 rxovf6 rxovf5 rxovf4 rxovf3 rxovf2 rxovf1 rxovf0 0000 c1rxovf2 042a rxovf31 rxovf30 rxovf29 rxovf28 rxovf27 rxovf26 rxovf25 r xovf24 rxovf23 rxovf22 rxovf21 rxovf20 rxovf19 rxovf18 rxovf17 rxovf16 0000 c1tr01con 0430 txen1 txabt1 txlarb1 txerr1 txreq1 rtren1 tx1pri <1:0> txen0 txabat0 txlarb0 txerr0 txreq0 rtren0 tx0pri<1:0> 0000 c1tr23con 0432 txen3 txabt3 txlarb3 txerr3 txreq3 rtren3 tx3pri <1:0> txen2 txabat2 txlarb2 txerr2 txreq2 rtren2 tx2pri<1:0> 0000 c1tr45con 0434 txen5 txabt5 txlarb5 txerr5 txreq5 rtren5 tx5pri <1:0> txen4 txabat4 txlarb4 txerr4 txreq4 rtren4 tx4pri<1:0> 0000 c1tr67con 0436 txen7 txabt7 txlarb7 txerr7 txreq7 rtren7 tx7pri <1:0> txen6 txabat6 txlarb6 txerr6 txreq6 rtren6 tx6pri<1:0> xxxx c1rxd 0440 received data word xxxx c1txd 0442 transmit data word xxxx legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
DSPIC33EPXXXGP50X, dspic33epxxxm c20x/50x, and pi c24epxxxgp/mc20x ds70657d-page 80 preliminary ? 2011 microchip technology inc. table 4-23: ecan1 register ma p when win (c1ctrl<0>) = 1 for dspic33epxxxmc/gp50x devices only file name addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets 0400- 041e see definition when win = x c1bufpnt1 0420 f3bp<3:0> f2bp<3:0> f1bp<3:0> f0bp<3:0> 0000 c1bufpnt2 0422 f7bp<3:0> f6bp<3:0> f5bp<3:0> f4bp<3:0> 0000 c1bufpnt3 0424 f11bp<3:0> f10bp<3:0> f9bp<3:0> f8bp<3:0> 0000 c1bufpnt4 0426 f15bp<3:0> f14bp<3:0> f13bp<3:0> f12bp<3:0> 0000 c1rxm0sid 0430 sid<10:3> sid<2:0> ?mide ? eid<17:16> xxxx c1rxm0eid 0432 eid<15:8> eid<7:0> xxxx c1rxm1sid 0434 sid<10:3> sid<2:0> ?mide ? eid<17:16> xxxx c1rxm1eid 0436 eid<15:8> eid<7:0> xxxx c1rxm2sid 0438 sid<10:3> sid<2:0> ?mide ? eid<17:16> xxxx c1rxm2eid 043a eid<15:8> eid<7:0> xxxx c1rxf0sid 0440 sid<10:3> sid<2:0> ?exide ? eid<17:16> xxxx c1rxf0eid 0442 eid<15:8> eid<7:0> xxxx c1rxf1sid 0444 sid<10:3> sid<2:0> ?exide ? eid<17:16> xxxx c1rxf1eid 0446 eid<15:8> eid<7:0> xxxx c1rxf2sid 0448 sid<10:3> sid<2:0> ?exide ? eid<17:16> xxxx c1rxf2eid 044a eid<15:8> eid<7:0> xxxx c1rxf3sid 044c sid<10:3> sid<2:0> ?exide ? eid<17:16> xxxx c1rxf3eid 044e eid<15:8> eid<7:0> xxxx c1rxf4sid 0450 sid<10:3> sid<2:0> ?exide ? eid<17:16> xxxx c1rxf4eid 0452 eid<15:8> eid<7:0> xxxx c1rxf5sid 0454 sid<10:3> sid<2:0> ?exide ? eid<17:16> xxxx c1rxf5eid 0456 eid<15:8> eid<7:0> xxxx c1rxf6sid 0458 sid<10:3> sid<2:0> ?exide ? eid<17:16> xxxx c1rxf6eid 045a eid<15:8> eid<7:0> xxxx c1rxf7sid 045c sid<10:3> sid<2:0> ?exide ? eid<17:16> xxxx c1rxf7eid 045e eid<15:8> eid<7:0> xxxx c1rxf8sid 0460 sid<10:3> sid<2:0> ?exide ? eid<17:16> xxxx c1rxf8eid 0462 eid<15:8> eid<7:0> xxxx c1rxf9sid 0464 sid<10:3> sid<2:0> ?exide ? eid<17:16> xxxx c1rxf9eid 0466 eid<15:8> eid<7:0> xxxx c1rxf10sid 0468 sid<10:3> sid<2:0> ?exide ? eid<17:16> xxxx c1rxf10eid 046a eid<15:8> eid<7:0> xxxx c1rxf11sid 046c sid<10:3> sid<2:0> ?exide ? eid<17:16> xxxx c1rxf11eid 046e eid<15:8> eid<7:0> xxxx c1rxf12sid 0470 sid<10:3> sid<2:0> ?exide ? eid<17:16> xxxx c1rxf12eid 0472 eid<15:8> eid<7:0> xxxx legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011 microchip technology inc. preliminary ds70657d-page 81 DSPIC33EPXXXGP50X, dspi c33epxxxmc20x/50x, and pic24epxxxgp/mc20x c1rxf13sid 0474 sid<10:3> sid<2:0> ?exide ? eid<17:16> xxxx c1rxf13eid 0476 eid<15:8> eid<7:0> xxxx c1rxf14sid 0478 sid<10:3> sid<2:0> ?exide ? eid<17:16> xxxx c1rxf14eid 047a eid<15:8> eid<7:0> xxxx c1rxf15sid 047c sid<10:3> sid<2:0> ?exide ? eid<17:16> xxxx c1rxf15eid 047e eid<15:8> eid<7:0> xxxx table 4-23: ecan1 register ma p when win (c1ctrl<0>) = 1 for dspic33epxxxmc/gp50x d evices only (continued) file name addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
DSPIC33EPXXXGP50X, dspic33epxxxm c20x/50x, and pi c24epxxxgp/mc20x ds70657d-page 82 preliminary ? 2011 microchip technology inc. table 4-24: crc register map table 4-25: peripheral pin select output register ma p for dspic33epxxxgp/mc202/5 02 and pic24epxxxgp/mc202 devices only table 4-26: peripheral pin select output register ma p for dspic33epxxxgp/mc203/5 03 and pic24epxxxgp/mc203 devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets crccon1 0640 crcen ? csidl vword<4:0> crcful crcmpt crcisel crcgo lendian ? ? ? 0000 crccon2 0642 ? ? ? dwidth<4:0> ? ? ? plen<4:0> 0000 crcxorl 0644 x<15:1> ? 0000 crcxorh 0646 x<23:16> 0000 crcdatl 0648 crc data input low word 0000 crcdath 064a crc data input high word 0000 crcwdatl 064c crc result low word 0000 crcwdath 064e crc result high word 0000 legend: ? = unimplemented, read as ? 0 ?. shaded bits are not used in the operation of the programmable crc module. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets rpor0 0680 ? ? rp35r<5:0> ? ? rp20r<5:0> 0000 rpor1 0682 ? ? rp37r<5:0> ? ?rp36r<5:0> 0000 rpor2 0684 ? ? rp39r<5:0> ? ?rp38r<5:0> 0000 rpor3 0686 ? ? rp41r<5:0> ? ?rp40r<5:0> 0000 rpor4 0688 ? ? rp43r<5:0> ? ? rp42r<5:0> 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets rpor0 0680 ? ? rp35r<5:0> ? ? rp20r<5:0> 0000 rpor1 0682 ? ? rp37r<5:0> ? ?rp36r<5:0> 0000 rpor2 0684 ? ? rp39r<5:0> ? ?rp38r<5:0> 0000 rpor3 0686 ? ? rp41r<5:0> ? ?rp40r<5:0> 0000 rpor4 0688 ? ? rp43r<5:0> ? ? rp42r<5:0> 0000 rpor5 068a ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 rpor6 068c ? ? ? ? ? ? ? ? ? ? rp56r<5:0> 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011 microchip technology inc. preliminary ds70657d-page 83 DSPIC33EPXXXGP50X, dspi c33epxxxmc20x/50x, and pic24epxxxgp/mc20x table 4-27: peripheral pin select output register ma p for dspic33epxxxgp/mc204/5 04 and pic24epxxxgp/mc204 devices only table 4-28: peripheral pin select output register ma p for dspic33epxxxgp/mc206/5 06 and pic24epxxxgp/mc206 devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets rpor0 0680 ? ? rp35r<5:0> ? ? rp20r<5:0> 0000 rpor1 0682 ? ? rp37r<5:0> ? ?rp36r<5:0> 0000 rpor2 0684 ? ? rp39r<5:0> ? ?rp38r<5:0> 0000 rpor3 0686 ? ? rp41r<5:0> ? ?rp40r<5:0> 0000 rpor4 0688 ? ? rp43r<5:0> ? ? rp42r<5:0> 0000 rpor5 068a ? ? rp55r<5:0> ? ? rp54r<5:0> 0000 rpor6 068c ? ? rp57r<5:0> ? ? rp56r<5:0> 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets rpor0 0680 ? ? rp35r<5:0> ? ? rp20r<5:0> 0000 rpor1 0682 ? ? rp37r<5:0> ? ?rp36r<5:0> 0000 rpor2 0684 ? ? rp39r<5:0> ? ?rp38r<5:0> 0000 rpor3 0686 ? ? rp41r<5:0> ? ?rp40r<5:0> 0000 rpor4 0688 ? ? rp43r<5:0> ? ? rp42r<5:0> 0000 rpor5 068a ? ? rp55r<5:0> ? ? rp54r<5:0> 0000 rpor6 068c ? ? rp57r<5:0> ? ? rp56r<5:0> 0000 rpor7 068e ? ? rp97r<5:0> ? ? ? ? ? ? ? ? 0000 rpor8 0690 ? ? rp118r<5:0> ? ? ? ? ? ? ? ? 0000 rpor9 0692 ? ? ? ? ? ? ? ? ? ? rp120r<5:0> 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
DSPIC33EPXXXGP50X, dspic33epxxxm c20x/50x, and pi c24epxxxgp/mc20x ds70657d-page 84 preliminary ? 2011 microchip technology inc. table 4-29: peripheral pin select input regi ster map for pic24epxxxmc20x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets rpinr0 06a0 ?int1r<6:0> ? ? ? ? ? ? ? ? 0000 rpinr1 06a2 ? ? ? ? ? ? ? ? ?int2r<6:0> 0000 rpinr3 06a6 ? ? ? ? ? ? ? ? ?t2ckr<6:0> 0000 rpinr7 06ae ?ic2r<6:0> ?ic1r<6:0> 0000 rpinr8 06b0 ?ic4r<6:0> ?ic3r<6:0> 0000 rpinr11 06b6 ? ? ? ? ? ? ? ? ?ocfar<6:0> 0000 rpinr12 06b8 ?flt2r<6:0> ?flt1r<6:0> 0000 rpinr14 06bc ?qeb1r<6:0> ?qea1r<6:0> 0000 rpinr15 06be ? home1r<6:0> ? indx1r<6:0> 0000 rpinr18 06c4 ? ? ? ? ? ? ? ? ?u1rxr<6:0> 0000 rpinr19 06c6 ? ? ? ? ? ? ? ? ?u2rxr<6:0> 0000 rpinr22 06cc ? sck2inr<6:0> ?sdi2r<6:0> 0000 rpinr23 06ce ? ? ? ? ? ? ? ? ? ss2r<6:0> 0000 rpinr26 06d4 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 rpinr37 06ea ? synci1r<6:0> ? ? ? ? ? ? ? ? 0000 rpinr38 06ec ?dtcmp1r<6:0> ? ? ? ? ? ? ? ? 0000 rpinr39 06ee ?dtcmp3r<6:0> ?dtcmp2r<6:0> 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. table 4-30: peripheral pin select input regi ster map for pic24 epxxxgp20x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets rpinr0 06a0 ?int1r<6:0> ? ? ? ? ? ? ? ? 0000 rpinr1 06a2 ? ? ? ? ? ? ? ? ?int2r<6:0> 0000 rpinr3 06a6 ? ? ? ? ? ? ? ? ?t2ckr<6:0> 0000 rpinr7 06ae ?ic2r<6:0> ?ic1r<6:0> 0000 rpinr8 06b0 ?ic4r<6:0> ?ic3r<6:0> 0000 rpinr11 06b6 ? ? ? ? ? ? ? ? ?ocfar<6:0> 0000 rpinr18 06c4 ? ? ? ? ? ? ? ? ?u1rxr<6:0> 0000 rpinr19 06c6 ? ? ? ? ? ? ? ? ?u2rxr<6:0> 0000 rpinr22 06cc ? sck2inr<6:0> ?sdi2r<6:0> 0000 rpinr23 06ce ? ? ? ? ? ? ? ? ? ss2r<6:0> 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011 microchip technology inc. preliminary ds70657d-page 85 DSPIC33EPXXXGP50X, dspi c33epxxxmc20x/50x, and pic24epxxxgp/mc20x table 4-31: peripheral pin select input regi ster map for dspic33 epxxxgp50x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets rpinr0 06a0 ?int1r<6:0> ? ? ? ? ? ? ? ? 0000 rpinr1 06a2 ? ? ? ? ? ? ? ? ?int2r<6:0> 0000 rpinr3 06a6 ? ? ? ? ? ? ? ? ?t2ckr<6:0> 0000 rpinr7 06ae ? ic2r<6:0> ? ic1r<6:0> 0000 rpinr8 06b0 ? ic4r<6:0> ? ic3r<6:0> 0000 rpinr11 06b6 ? ? ? ? ? ? ? ? ?ocfar<6:0> 0000 rpinr18 06c4 ? ? ? ? ? ? ? ? ?u1rxr<6:0> 0000 rpinr19 06c6 ? ? ? ? ? ? ? ? ?u2rxr<6:0> 0000 rpinr22 06cc ? sck2inr<6:0> ?sdi2r<6:0> 0000 rpinr23 06ce ? ? ? ? ? ? ? ? ? ss2r<6:0> 0000 rpinr26 06d4 ? ? ? ? ? ? ? ? ?c1rxr<6:0> 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. table 4-32: peripheral pin select input regi ster map for dspic33epxxxmc50x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets rpinr0 06a0 ?int1r<6:0> ? ? ? ? ? ? ? ? 0000 rpinr1 06a2 ? ? ? ? ? ? ? ? ?int2r<6:0> 0000 rpinr3 06a6 ? ? ? ? ? ? ? ? ?t2ckr<6:0> 0000 rpinr7 06ae ? ic2r<6:0> ? ic1r<6:0> 0000 rpinr8 06b0 ? ic4r<6:0> ? ic3r<6:0> 0000 rpinr11 06b6 ? ? ? ? ? ? ? ? ?ocfar<6:0> 0000 rpinr12 06b8 ?flt2r<6:0> ?flt1r<6:0> 0000 rpinr14 06bc ?qeb1r<6:0> ? qea1r<6:0> 0000 rpinr15 06be ? home1r<6:0> ? indx1r<6:0> 0000 rpinr18 06c4 ? ? ? ? ? ? ? ? ?u1rxr<6:0> 0000 rpinr19 06c6 ? ? ? ? ? ? ? ? ?u2rxr<6:0> 0000 rpinr22 06cc ? sck2inr<6:0> ?sdi2r<6:0> 0000 rpinr23 06ce ? ? ? ? ? ? ? ? ? ss2r<6:0> 0000 rpinr26 06d4 ? ? ? ? ? ? ? ? ?c1rxr<6:0> 0000 rpinr37 06ea ? synci1r<6:0> ? ? ? ? ? ? ? ? 0000 rpinr38 06ec ?dtcmp1r<6:0> ? ? ? ? ? ? ? ? 0000 rpinr39 06ee ?dtcmp3r<6:0> ?dtcmp2r<6:0> 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
DSPIC33EPXXXGP50X, dspic33epxxxm c20x/50x, and pi c24epxxxgp/mc20x ds70657d-page 86 preliminary ? 2011 microchip technology inc. table 4-33: peripheral pin select input regi ster map for dspic33epxxxmc20x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets rpinr0 06a0 ?int1r<6:0> ? ? ? ? ? ? ? ? 0000 rpinr1 06a2 ? ? ? ? ? ? ? ? ?int2r<6:0> 0000 rpinr3 06a6 ? ? ? ? ? ? ? ? ?t2ckr<6:0> 0000 rpinr7 06ae ? ic2r<6:0> ? ic1r<6:0> 0000 rpinr8 06b0 ? ic4r<6:0> ? ic3r<6:0> 0000 rpinr11 06b6 ? ? ? ? ? ? ? ? ?ocfar<6:0> 0000 rpinr12 06b8 ?flt2r<6:0> ?flt1r<6:0> 0000 rpinr14 06bc ?qeb1r<6:0> ? qea1r<6:0> 0000 rpinr15 06be ? home1r<6:0> ? indx1r<6:0> 0000 rpinr18 06c4 ? ? ? ? ? ? ? ? ?u1rxr<6:0> 0000 rpinr19 06c6 ? ? ? ? ? ? ? ? ?u2rxr<6:0> 0000 rpinr22 06cc ? sck2inr<6:0> ?sdi2r<6:0> 0000 rpinr23 06ce ? ? ? ? ? ? ? ? ? ss2r<6:0> 0000 rpinr37 06ea ? synci1r<6:0> ? ? ? ? ? ? ? ? 0000 rpinr38 06ec ?dtcmp1r<6:0> ? ? ? ? ? ? ? ? 0000 rpinr39 06ee ?dtcmp3r<6:0> ?dtcmp2r<6:0> 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011 microchip technology inc. preliminary ds70657d-page 87 DSPIC33EPXXXGP50X, dspi c33epxxxmc20x/50x, and pic24epxxxgp/mc20x table 4-34: nvm register map table 4-35: system control register map table 4-36: reference clock register map file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets nvmcon 0728 wr wren wrerr nvmsidl ? ? ? ? ? ? ? ? nvmop<3:0> 0000 nvmadr 072a nvmadr<15:0> 0000 nvmadru 072c ? ? ? ? ? ? ? ? nvmadr<23:16> 0000 nvmkey 072e ? ? ? ? ? ? ? ? nvmkey<7:0> 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets rcon 0740 trapr iopuwr ? ?vregsf ? cm vregs extr swr swdten wdto sleep idle bor por note 1 osccon 0742 ? cosc<2:0> ? nosc<2:0> clklock iolock lock ?cf ? ? oswen note 2 clkdiv 0744 roi doze<2:0> do zen frcdiv<2:0> pllpost<1:0> ? pllpre<4:0> 0030 pllfbd 0746 ? ? ? ? ? ? ? plldiv<8:0> 0030 osctun 0748 ? ? ? ? ? ? ? ? ? ? tun<5:0> 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. note 1: rcon register reset values dependent on type of reset. 2: osccon register reset values dependent on configuration fuses, and by type of reset. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets refocon 074e roon ? rosslp rosel rodiv<3:0> ? ? ? ? ? ? ? ? 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
DSPIC33EPXXXGP50X, dspic33epxxxm c20x/50x, and pi c24epxxxgp/mc20x ds70657d-page 88 preliminary ? 2011 microchip technology inc. table 4-37: pmd register map for pic24epxxxgp20x devices only table 4-38: pmd register map for pic24epxxxmc20x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets pmd1 0760 t5md t4md t3md t2md t1md ? ? ? i2c1md u2md u1md spi2md spi1md ? ?ad1md 0000 pmd2 0762 ? ? ? ? ic4md ic3md ic2md ic1md ? ? ? ? oc4md oc3md oc2md oc1md 0000 pmd3 0764 ? ? ? ? ?cmpmd ? ? crcmd ? ? ? ? ?i2c2md ? 0000 pmd4 0766 ? ? ? ? ? ? ? ? ? ? ? ?refomdctmumd ? ? 0000 pmd6 076a ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 pmd7 076c ? ? ? ? ? ? ? ? ? ? ? dma0md ptgmd ? ? ? 0000 dma1md dma2md dma3md legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets pmd1 0760 t5md t4md t3md t2md t1md qei1md pwmmd ? i2c1md u2md u1md spi2md spi1md ? ?ad1md 0000 pmd2 0762 ? ? ? ? ic4md ic3md ic2md ic1md ? ? ? ? oc4md oc3md oc2md oc1md 0000 pmd3 0764 ? ? ? ? ? cmpmd ? ? crcmd ? ? ? ? ? i2c2md ? 0000 pmd4 0766 ? ? ? ? ? ? ? ? ? ? ? ?refomdctmumd ? ? 0000 pmd6 076a ? ? ? ? ? pwm3md pwm2md pwm1md ? ? ? ? ? ? ? ? 0000 pmd7 076c ? ? ? ? ? ? ? ? ? ? ? dma0md ptgmd ? ? ? 0000 dma1md dma2md dma3md legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011 microchip technology inc. preliminary ds70657d-page 89 DSPIC33EPXXXGP50X, dspi c33epxxxmc20x/50x, and pic24epxxxgp/mc20x table 4-39: pmd register map fo r DSPIC33EPXXXGP50X devices only table 4-40: pmd register map fo r dspic33epxxxmc50x devices only table 4-41: pmd register map fo r dspic33epxxxmc20x devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets pmd1 0760 t5md t4md t3md t2md t1md ? ? ? i2c1md u2md u1md spi2md spi1md ?c1mdad1md 0000 pmd2 0762 ? ? ? ? ic4md ic3md ic2md ic1md ? ? ? ? oc4md oc3md oc2md oc1md 0000 pmd3 0764 ? ? ? ? ?cmpmd ? ? crcmd ? ? ? ? ?i2c2md ? 0000 pmd4 0766 ? ? ? ? ? ? ? ? ? ? ? ?refomdctmumd ? ? 0000 pmd6 076a ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0000 pmd7 076c ? ? ? ? ? ? ? ? ? ? ? dma0md ptgmd ? ? ? 0000 dma1md dma2md dma3md legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets pmd1 0760 t5md t4md t3md t2md t1md qei1md pwmmd ? i2c1md u2md u1md spi2md spi1md ?c1mdad1md 0000 pmd2 0762 ? ? ? ? ic4md ic3md ic2md ic1md ? ? ? ? oc4md oc3md oc2md oc1md 0000 pmd3 0764 ? ? ? ? ? cmpmd ? ? crcmd ? ? ? ? ? i2c2md ? 0000 pmd4 0766 ? ? ? ? ? ? ? ? ? ? ? ?refomdctmumd ? ? 0000 pmd6 076a ? ? ? ? ? pwm3md pwm2md pwm1md ? ? ? ? ? ? ? ? 0000 pmd7 076c ? ? ? ? ? ? ? ? ? ? ? dma0md ptgmd ? ? ? 0000 dma1md dma2md dma3md legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets pmd1 0760 t5md t4md t3md t2md t1md qei1md pwmmd ? i2c1md u2md u1md spi2md spi1md ? ?ad1md 0000 pmd2 0762 ? ? ? ? ic4md ic3md ic2md ic1md ? ? ? ? oc4md oc3md oc2md oc1md 0000 pmd3 0764 ? ? ? ? ? cmpmd ? ? crcmd ? ? ? ? ?i2c2md ? 0000 pmd4 0766 ? ? ? ? ? ? ? ? ? ? ? ?refomdctmumd ? ? 0000 pmd6 076a ? ? ? ? ? pwm3md pwm2md pwm1md ? ? ? ? ? ? ? ? 0000 pmd7 076c ? ? ? ? ? ? ? ? ? ? ? dma0md ptgmd ? ? ? 0000 dma1md dma2md dma3md legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
DSPIC33EPXXXGP50X, dspic33epxxxm c20x/50x, and pi c24epxxxgp/mc20x ds70657d-page 90 preliminary ? 2011 microchip technology inc. table 4-42: op amp/comparator register map table 4-44: jtag interface register map file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets cmstat 0a80 psidl ? ? ? c4evt c3evt c2evt c1evt ? ? ? ? c4out c3out c2out c1out 0000 cvrcon 0a82 ?cvr2oe ? ? ?vrefsel ? ? cvren cvr1oe cvrr cvrss cvr<3:0> 0000 cm1con 0a84 con coe cpol ? ? opmode cevt cout evpol<1:0> ?cref ? ? cch<1:0> 0000 cm1msksrc 0a86 ? ? ? ? selsrcc<3:0> selsrcb<3:0> selsrca<3:0> 0000 cm1mskcon 0a88 hlms ? ocen ocnen oben obnen oaen oanen nags pags acen acnen aben abnen aaen aanen 0000 cm1fltr 0a8a ? ? ? ? ? ? ? ? ? cfsel<2:0> cfltren cfdiv<2:0> 0000 cm2con 0a8c con coe cpol ? ? opmode cevt cout evpol<1:0> ?cref ? ? cch<1:0> 0000 cm2msksrc 0a8e ? ? ? ? selsrcc<3:0> selsrcb<3:0> selsrca<3:0> 0000 cm2mskcon 0a90 hlms ? ocen ocnen oben obnen oaen oanen nags pags acen acnen aben abnen aaen aanen 0000 cm2fltr 0a92 ? ? ? ? ? ? ? ? ? cfsel<2:0> cfltren cfdiv<2:0> 0000 cm3con 0a94 con coe cpol ? ? opmode cevt cout evpol<1:0> ?cref ? ? cch<1:0> 0000 cm3msksrc 0a96 ? ? ? ? selsrcc<3:0> selsrcb<3:0> selsrca<3:0> 0000 cm3mskcon 0a98 hlms ? ocen ocnen oben obnen oaen oanen nags pags acen acnen aben abnen aaen aanen 0000 cm3fltr 0a9a ? ? ? ? ? ? ? ? ? cfsel<2:0> cfltren cfdiv<2:0> 0000 cm4con 0a9c con coe cpol ? ? ? cevt cout evpol<1:0> ?cref ? ? cch<1:0> 0000 cm4msksrc 0a9e ? ? ? ? selsrcc<3:0> selsrcb<3:0> selsrca<3:0> 0000 cm4mskcon 0aa0 hlms ? ocen ocnen oben obnen oaen oanen nags pags acen acnen aben abnen aaen aanen 0000 cm4fltr 0aa2 ? ? ? ? ? ? ? ? ? cfsel<2:0> cfltren cfdiv<2:0> 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. table 4-43: ctmu register map file name addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets ctmucon1 033a ctmuen ? ctmusidl tgen edgen edgseqen idissen cttrig ? ? ? ? ? ? ? ? 0000 ctmucon2 033c edg1mod edg1pol ? ? edg1sel<1:0> edg2stat edg1stat edg2mod edg2pol ? ?edg2sel<1:0> ? ? 0000 ctmuicon 033e itrim<5:0> irng<1:0> ? ? ? ? ? ? ? ? 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. file name addr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets jdatah 0ff0 ? ? ? ? jdatah<27:16> xxxx jdatal 0ff2 jdatal<15:0> 0000
? 2011 microchip technology inc. preliminary ds70657d-page 91 DSPIC33EPXXXGP50X, dspi c33epxxxmc20x/50x, and pic24epxxxgp/mc20x table 4-45: dmac register map file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets dma0con 0b00 chen size dir half nullw ? ? ? ? ?amode<1:0> ? ?mode<1:0> 0000 dma0req 0b02 force ? ? ? ? ? ? ? irqsel<7:0> 00ff dma0stal 0b04 sta<15:0> 0000 dma0stah 0b06 ? ? ? ? ? ? ? ?sta<23:16> 0000 dma0stbl 0b08 stb<15:0> 0000 dma0stbh 0b0a ? ? ? ? ? ? ? ? stb<23:16> 0000 dma0pad 0b0c pad<15:0> 0000 dma0cnt 0b0e ? ? cnt<13:0> 0000 dma1con 0b10 chen size dir half nullw ? ? ? ? ?amode<1:0> ? ?mode<1:0> 0000 dma1req 0b12 force ? ? ? ? ? ? ? irqsel<7:0> 00ff dma1stal 0b14 sta<15:0> 0000 dma1stah 0b16 ? ? ? ? ? ? ? ?sta<23:16> 0000 dma1stbl 0b18 stb<15:0> 0000 dma1stbh 0b1a ? ? ? ? ? ? ? ? stb<23:16> 0000 dma1pad 0b1c pad<15:0> 0000 dma1cnt 0b1e ? ? cnt<13:0> 0000 dma2con 0b20 chen size dir half nullw ? ? ? ? ?amode<1:0> ? ?mode<1:0> 0000 dma2req 0b22 force ? ? ? ? ? ? ? irqsel<7:0> 00ff dma2stal 0b24 sta<15:0> 0000 dma2stah 0b26 ? ? ? ? ? ? ? ?sta<23:16> 0000 dma2stbl 0b28 stb<15:0> 0000 dma2stbh 0b2a ? ? ? ? ? ? ? ? stb<23:16> 0000 dma2pad 0b2c pad<15:0> 0000 dma2cnt 0b2e ? ? cnt<13:0> 0000 dma3con 0b30 chen size dir half nullw ? ? ? ? ?amode<1:0> ? ?mode<1:0> 0000 dma3req 0b32 force ? ? ? ? ? ? ? irqsel<7:0> 00ff dma3stal 0b34 sta<15:0> 0000 dma3stah 0b36 ? ? ? ? ? ? ? ?sta<23:16> 0000 dma3stbl 0b38 stb<15:0> 0000 dma3stbh 0b3a ? ? ? ? ? ? ? ? stb<23:16> 0000 dma3pad 0b3c pad<15:0> 0000 dma3cnt 0b3e ? ? cnt<13:0> 0000 dmapwc 0bf0 ? ? ? ? ? ? ? ? ? ? ? ? pwcol3 pwcol2 pwcol1 pwcol0 0000 dmarqc 0bf2 ? ? ? ? ? ? ? ? ? ? ? ? rqcol3 rqcol2 rqcol1 rqcol0 0000 dmapps 0bf4 ? ? ? ? ? ? ? ? ? ? ? ? ppst3 ppst2 ppst1 ppst0 0000 dmalca 0bf6 ? ? ? ? ? ? ? ? ? ? ? ?lstch<3:0> 000f dsadrl 0bf8 dsadr<15:0> 0000 dsadrh 0bfa ? ? ? ? ? ? ? ? dsadr<23:16> 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
DSPIC33EPXXXGP50X, dspic33epxxxm c20x/50x, and pi c24epxxxgp/mc20x ds70657d-page 92 preliminary ? 2011 microchip technology inc. table 4-46: porta register map for pic24epxxxgp/mc206 and dspic33epxxxgp/mc 206/506 devices only table 4-47: portb register map for pic24epxxxgp/ mc206 and dspic33epxxxgp/ mc206/506 devices only table 4-48: portc register map for pic24epxxxgp/ mc206 and dspic33epxxxgp/ mc206/506 devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trisa 0e00 ? ? ? trisa12 trisa11 trisa10 trisa9 trisa8 trisa7 ? ?trisa4 ? ? trisa1 trisa0 1f93 porta 0e02 ? ? ? ra12 ra11 ra10 ra9 ra8 ra7 ? ?ra4 ? ?ra1ra0 0000 lata 0e04 ? ? ? lata12 lata11 lata10 lata9 lata8 lata7 ? ?lata4 ? ? la1ta1 la0ta0 0000 odca 0e06 ? ? ? odca12 odca11 odca10 odca9 odca8 odca7 ? ? odca4 ? ? odca1 odca0 0000 cnena 0e08 ? ? ? cniea12 cniea11 cniea 10 cniea9 cniea8 cniea7 ? ? cniea4 ? ? cniea1 cniea0 0000 cnpua 0e0a ? ? ? cnpua12 cnpua11 cnpua10 cnpua9 cnpua8 cnpua7 ? ? cnpua4 ? ? cnpua1 cnpua0 0000 cnpda 0e0c ? ? ? cnpda12 cnpda11 cnpda10 cnpda9 cnpda8 cnpda7 ? ? cnpda4 ? ? cnpda1 cnpda0 0000 ansela 0e0e ? ? ? ansa12 ansa11 ? ? ? ? ? ?ansa4 ? ? ansa1 ansa0 1813 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trisb 0e10 trisb15 trisb14 trisb13 trisb12 trisb11 trisb10 trisb9 trisb8 trisb7 trisb6 trisb5 trisb4 trisb3 trisb2 trisb1 trisb0 ffff portb 0e12 rb15 rb14 rb13 rb12 rb11 rb10 rb9 rb8 rb7 rb6 rb5 rb4 rb3 rb2 rb1 rb0 xxxx latb 0e14 latb15 latb14 latb13 latb12 latb11 latb10 latb9 latb8 latb7 latb6 latb5 latb4 latb3 latb2 latb1 latb0 xxxx odcb 0e16 odcb15 odcb14 odcb13 odcb 12 odcb11 odcb10 odcb9 odcb8 odcb7 o dcb6 odcb5 odcb4 odcb3 odcb2 odcb1 odcb0 0000 cnenb 0e18 cnieb15 cnieb14 cnieb13 cnieb12 cnieb11 cnieb10 cni eb9 cnieb8 cnieb7 cnieb6 cnieb5 cnieb4 cnieb3 cnieb2 cnieb1 cnieb0 0000 cnpub 0e1a cnpub15 cnpub14 cnpub13 cnpub12 cnpub11 cnpub10 cnpub9 cnpub8 cnpub7 cnpub6 cnpub5 cnpub 4 cnpub3 cnpub2 cnpub1 cnpub0 0000 cnpdb 0e1c cnpdb15 cnpdb14 cnpdb13 cnpdb12 cnpdb11 cnpdb10 cnpdb9 cnpdb8 cnpdb7 cnpdb6 cnpdb5 cnpdb 4 cnpdb3 cnpdb2 cnpdb1 cnpdb0 0000 anselb 0e1e ? ? ? ? ? ? ?ansb8 ? ? ? ? ansb3 ansb2 ansb1 ansb0 010f legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trisc 0e20 trisc15 ? trisc13 trisc12 trisc11 trisc10 t risc9 trisc8 trisc7 trisc6 trisc5 t risc4 trisc3 trisc2 trisc1 trisc0 bfff portc 0e22 rc15 ? rc13 rc12 rc11 rc10 rc9 rc8 rc7 rc6 rc5 rc4 rc3 rc2 rc1 rc0 xxxx latc 0e24 latc15 ? latc13 latc12 latc11 latc10 latc9 latc8 latc7 latc6 latc5 latc4 latc3 latc2 latc1 latc0 xxxx odcc 0e26 odcc15 ? odcc13 odcc12 odcc11 odcc10 odcc9 odcc8 o dcc7 odcc6 odcc5 odcc4 odcc3 odcc2 odcc1 odcc0 0000 cnenc 0e28 cniec15 ? cniec13 cniec12 cniec11 cniec10 cniec9 cniec8 cniec7 cniec6 cniec5 cniec4 cniec3 cniec2 cniec1 cniec0 0000 cnpuc 0e2a cnpuc15 ? cnpuc13 cnpuc12 cnpuc11 cnpuc10 cnpuc9 cnpuc8 cnpuc7 cnpuc6 cnpuc5 cnpuc4 cnpuc3 cnpuc2 cnpuc1 cnpuc0 0000 cnpdc 0e2c cnpdc15 ? cnpdc13 cnpdc12 cnpdc11 cnpdc10 cnpdc9 cnpdc8 cnpdc7 cnpdc6 cnpdc5 cnpdc4 cnpdc3 cnpdc2 cnpdc1 cnpdc0 0000 anselc 0e2e ? ? ? ? ansc11 ? ? ? ? ? ? ? ? ansc2 ansc1 ansc0 0807 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011 microchip technology inc. preliminary ds70657d-page 93 DSPIC33EPXXXGP50X, dspi c33epxxxmc20x/50x, and pic24epxxxgp/mc20x table 4-49: portd register map for pic24epxxxgp/ mc206 and dspic33epxxxgp/ mc206/506 devices only table 4-50: porte register map for pic24epxxxg p/mc206 and dspic33epxxxgp/ mc206/506 devices only table 4-51: portf register map for pic24epxxxgp/mc206 and dspic33epxxxgp/mc206/506 devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trisd 0e30 ? ? ? ? ? ? ?trisd8 ? trisd6 trisd5 ? ? ? ? ? 0160 portd 0e32 ? ? ? ? ? ? ? rd8 ? rd6 rd5 ? ? ? ? ? xxxx latd 0e34 ? ? ? ? ? ? ?latd8 ?latd6latd5 ? ? ? ? ? xxxx odcd 0e36 ? ? ? ? ? ? ? odcd8 ? odcd6 odcd5 ? ? ? ? ? 0000 cnend 0e38 ? ? ? ? ? ? ? cnied8 ? cnied6 cnied5 ? ? ? ? ? 0000 cnpud 0e3a ? ? ? ? ? ? ? cnpud8 ? cnpud6 cnpud5 ? ? ? ? ? 0000 cnpdd 0e3c ? ? ? ? ? ? ? cnpdd8 ? cnpdd6 cnpdd5 ? ? ? ? ? 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trise 0e40 trise15 trise14 trise13 trise12 ? ? ? ? ? ? ? ? ? ? ? ? f000 porte 0e42 re15 re14 re13 re12 ? ? ? ? ? ? ? ? ? ? ? ? xxxx late 0e44 late15 late14 late13 late12 ? ? ? ? ? ? ? ? ? ? ? ? xxxx odce 0e46 odce15 odce14 odce13 odce12 ? ? ? ? ? ? ? ? ? ? ? ? 0000 cnene 0e48 cniee15 cniee14 cniee13 cniee12 ? ? ? ? ? ? ? ? ? ? ? ? 0000 cnpue 0e4a cnpue15 cnpue14 cnpue13 cnpue12 ? ? ? ? ? ? ? ? ? ? ? ? 0000 cnpde 0e4c cnpde15 cnpde14 cnpde13 cnpde12 ? ? ? ? ? ? ? ? ? ? ? ? 0000 ansele 0e4e anse15 anse14 anse13 anse12 ? ? ? ? ? ? ? ? ? ? ? ? 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trisf 0e50 ? ? ? ? ? ? ? ? ? ? ? ? ? ? trisf1 trisf0 0173 portf 0e52 ? ? ? ? ? ? ? ? ? ? ? ? ? ?rf1rf0 xxxx latf 0e54 ? ? ? ? ? ? ? ? ? ? ? ? ? ? latf1 latf0 xxxx odcf 0e56 ? ? ? ? ? ? ? ? ? ? ? ? ? ? odcf1 odcf0 0000 cnenf 0e58 ? ? ? ? ? ? ? ? ? ? ? ? ? ? cnief1 cnief0 0000 cnpuf 0e5a ? ? ? ? ? ? ? ? ? ? ? ? ? ? cnpuf1 cnpuf0 0000 cnpdf 0e5c ? ? ? ? ? ? ? ? ? ? ? ? ? ? cnpdf1 cnpdf0 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
DSPIC33EPXXXGP50X, dspic33epxxxm c20x/50x, and pi c24epxxxgp/mc20x ds70657d-page 94 preliminary ? 2011 microchip technology inc. table 4-52: portg register map for pic24epxxxg p/mc206 and dspic33epxxxgp /mc206/506 devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trisg 0e60 ? ? ? ? ? ? trisg9 trisg8 trisg7 trisg6 ? ? ? ? ? ? 03c0 portg 0e62 ? ? ? ? ? ? rg9 rg8 rg7 rg6 ? ? ? ? ? ? xxxx latg 0e64 ? ? ? ? ? ? latg9 latg8 latg7 latg6 ? ? ? ? ? ? xxxx odcg 0e66 ? ? ? ? ? ? odcg9 odcg8 odcg7 odcg6 ? ? ? ? ? ? 0000 cneng 0e68 ? ? ? ? ? ? cnieg9 cnieg8 cnieg7 cnieg6 ? ? ? ? ? ? 0000 cnpug 0e6a ? ? ? ? ? ? cnpug9 cnpug8 cnpug7 cnpug6 ? ? ? ? ? ? 0000 cnpdg 0e6c ? ? ? ? ? ? cnpdg9 cnpdg8 cnpdg7 cnpdg6 ? ? ? ? ? ? 0000 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011 microchip technology inc. preliminary ds70657d-page 95 DSPIC33EPXXXGP50X, dspi c33epxxxmc20x/50x, and pic24epxxxgp/mc20x table 4-53: porta register map for pic24epxxxgp/mc204 and dspic33epxxxgp/mc 204/504 devices only table 4-54: portb register map for pic24epxxxgp/ mc204 and dspic33epxxxgp/ mc204/504 devices only table 4-55: portc register map for pic24epxxxgp/ mc204 and dspic33epxxxgp/ mc204/504 devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trisa 0e00 ? ? ? ? ? trisa10 trisa9 trisa8 trisa7 ? ? trisa4trisa3trisa2trisa1trisa0 079f porta 0e02 ? ? ? ? ? ra10 ra9 ra8 ra7 ? ? ra4 ra3 ra2 ra1 ra0 0000 lata 0e04 ? ? ? ? ? lata10 lata9 lata8 lata7 ? ? lata4 lata3 lata2 la1ta1 la0ta0 0000 odca 0e06 ? ? ? ? ? odca10 odca9 odca8 odca7 ? ? odca4 odca3 odca2 odca1 odca0 0000 cnena 0e08 ? ? ? ? ? cniea10 cniea9 cniea8 cniea7 ? ? cniea4 cniea3 cni ea2 cniea1 cniea0 0000 cnpua 0e0a ? ? ? ? ? cnpua10 cnpua9 cnpua8 cnpua7 ? ? cnpua4 cnpua3 cnpua2 cnpua1 cnpua0 0000 cnpda 0e0c ? ? ? ? ? cnpda10 cnpda9 cnpda8 cnpda7 ? ? cnpda4 cnpda3 cnpda2 cnpda1 cnpda0 0000 ansela 0e0e ? ? ? ? ? ? ? ? ? ? ?ansa4 ? ? ansa1 ansa0 0013 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trisb 0e10 trisb15 trisb14 trisb13 trisb12 trisb11 trisb10 trisb9 trisb8 trisb7 trisb6 trisb5 trisb4 trisb3 trisb2 trisb1 trisb0 ffff portb 0e12 rb15 rb14 rb13 rb12 rb11 rb10 rb9 rb8 rb7 rb6 rb5 rb4 rb3 rb2 rb1 rb0 xxxx latb 0e14 latb15 latb14 latb13 latb12 latb11 latb10 latb9 latb8 latb7 latb6 latb5 latb4 latb3 latb2 latb1 latb0 xxxx odcb 0e16 odcb15 odcb14 odcb13 odcb 12 odcb11 odcb10 odcb9 odcb8 odcb7 o dcb6 odcb5 odcb4 odcb3 odcb2 odcb1 odcb0 0000 cnenb 0e18 cnieb15 cnieb14 cnieb13 cnieb12 cnieb11 cnieb10 cni eb9 cnieb8 cnieb7 cnieb6 cnieb5 cnieb4 cnieb3 cnieb2 cnieb1 cnieb0 0000 cnpub 0e1a cnpub15 cnpub14 cnpub13 cnpub12 cnpub11 cnpub10 cnpub9 cnpub8 cnpub7 cnpub6 cnpub5 cnpub 4 cnpub3 cnpub2 cnpub1 cnpub0 0000 cnpdb 0e1c cnpdb15 cnpdb14 cnpdb13 cnpdb12 cnpdb11 cnpdb10 cnpdb9 cnpdb8 cnpdb7 cnpdb6 cnpdb5 cnpdb 4 cnpdb3 cnpdb2 cnpdb1 cnpdb0 0000 anselb 0e1e ? ? ? ? ? ? ?ansb8 ? ? ? ? ansb3 ansb2 ansb1 ansb0 010f legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trisc 0e20 ? ? ? ? ? ? trisc9 trisc8 trisc7 trisc6 trisc5 t risc4 trisc3 trisc2 trisc1 trisc0 03ff portc 0e22 ? ? ? ? ? ? rc9 rc8 rc7 rc6 rc5 rc4 rc3 rc2 rc1 rc0 xxxx latc 0e24 ? ? ? ? ? ? latc9 latc8 latc7 latc6 latc5 latc4 latc3 latc2 latc1 latc0 xxxx odcc 0e26 ? ? ? ? ? ? odcc9 odcc8 odcc7 odcc6 odcc5 odcc4 odcc3 odcc2 odcc1 odcc0 0000 cnenc 0e28 ? ? ? ? ? ? cniec9 cniec8 cniec7 cniec6 cniec5 cniec4 cniec3 cniec2 cniec1 cniec0 0000 cnpuc 0e2a ? ? ? ? ? ? cnpuc9 cnpuc8 cnpuc7 cnpuc6 cnpuc5 cnpuc4 cnpuc3 cnpuc2 cnpuc1 cnpuc0 0000 cnpdc 0e2c ? ? ? ? ? ? cnpdc9 cnpdc8 cnpdc7 cnpdc6 cnpdc5 cnpdc4 cnpdc3 cnpdc2 cnpdc1 cnpdc0 0000 anselc 0e2e ? ? ? ? ? ? ? ? ? ? ? ? ? ansc2 ansc1 ansc0 0007 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
DSPIC33EPXXXGP50X, dspic33epxxxm c20x/50x, and pi c24epxxxgp/mc20x ds70657d-page 96 preliminary ? 2011 microchip technology inc. table 4-56: porta register map for pic24epxxxgp/mc203 and dspic33epxxxgp/mc 203/503 devices only table 4-57: portb register map for pic24epxxxgp/ mc203 and dspic33epxxxgp/ mc203/503 devices only table 4-58: portc register map for pic24epxxxgp/ mc203 and dspic33epxxxgp/ mc203/503 devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trisa 0e00 ? ? ? ? ? ? ?trisa8 ? ? ? trisa4trisa3trisa2trisa1trisa0 011f porta 0e02 ? ? ? ? ? ? ?ra8 ? ? ? ra4 ra3 ra2 ra1 ra0 0000 lata 0e04 ? ? ? ? ? ? ?lata8 ? ? ? lata4 lata3 lata2 la1ta1 la0ta0 0000 odca 0e06 ? ? ? ? ? ? ? odca8 ? ? ? odca4 odca3 odca2 odca1 odca0 0000 cnena 0e08 ? ? ? ? ? ? ? cniea8 ? ? ? cniea4 cniea3 cni ea2 cniea1 cniea0 0000 cnpua 0e0a ? ? ? ? ? ? ? cnpua8 ? ? ? cnpua4 cnpua3 cnpua2 cnpua1 cnpua0 0000 cnpda 0e0c ? ? ? ? ? ? ? cnpda8 ? ? ? cnpda4 cnpda3 cnpda2 cnpda1 cnpda0 0000 ansela 0e0e ? ? ? ? ? ? ? ? ? ? ?ansa4 ? ? ansa1 ansa0 0013 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trisb 0e10 trisb15 trisb14 trisb13 trisb12 trisb11 trisb10 trisb9 trisb8 trisb7 trisb6 trisb5 trisb4 trisb3 trisb2 trisb1 trisb0 ffff portb 0e12 rb15 rb14 rb13 rb12 rb11 rb10 rb9 rb8 rb7 rb6 rb5 rb4 rb3 rb2 rb1 rb0 xxxx latb 0e14 latb15 latb14 latb13 latb12 latb11 latb10 latb9 latb8 latb7 latb6 latb5 latb4 latb3 latb2 latb1 latb0 xxxx odcb 0e16 odcb15 odcb14 odcb13 odcb 12 odcb11 odcb10 odcb9 odcb8 odcb7 o dcb6 odcb5 odcb4 odcb3 odcb2 odcb1 odcb0 0000 cnenb 0e18 cnieb15 cnieb14 cnieb13 cnieb12 cnieb11 cnieb10 cni eb9 cnieb8 cnieb7 cnieb6 cnieb5 cnieb4 cnieb3 cnieb2 cnieb1 cnieb0 0000 cnpub 0e1a cnpub15 cnpub14 cnpub13 cnpub12 cnpub11 cnpub10 cnpub9 cnpub8 cnpub7 cnpub6 cnpub5 cnpub 4 cnpub3 cnpub2 cnpub1 cnpub0 0000 cnpdb 0e1c cnpdb15 cnpdb14 cnpdb13 cnpdb12 cnpdb11 cnpdb10 cnpdb9 cnpdb8 cnpdb7 cnpdb6 cnpdb5 cnpdb 4 cnpdb3 cnpdb2 cnpdb1 cnpdb0 0000 anselb 0e1e ? ? ? ? ? ? ?ansb8 ? ? ? ? ansb3 ansb2 ansb1 ansb0 010f legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trisc 0e20 ? ? ? ? ? ? ?trisc8 ? ? ? ? ? ? trisc1 trisc0 0107 portc 0e22 ? ? ? ? ? ? ? rc8 ? ? ? ? ? ? rc1 rc0 xxxx latc 0e24 ? ? ? ? ? ? ?latc8 ? ? ? ? ? ?latc1latc0 xxxx odcc 0e26 ? ? ? ? ? ? ? odcc8 ? ? ? ? ? ? odcc1 odcc0 0000 cnenc 0e28 ? ? ? ? ? ? ? cniec8 ? ? ? ? ? ? cniec1 cniec0 0000 cnpuc 0e2a ? ? ? ? ? ? ? cnpuc8 ? ? ? ? ? ? cnpuc1 cnpuc0 0000 cnpdc 0e2c ? ? ? ? ? ? ? cnpdc8 ? ? ? ? ? ? cnpdc1 cnpdc0 0000 anselc 0e2e ? ? ? ? ? ? ? ? ? ? ? ? ? ? ansc1 ansc0 0007 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
? 2011 microchip technology inc. preliminary ds70657d-page 97 DSPIC33EPXXXGP50X, dspi c33epxxxmc20x/50x, and pic24epxxxgp/mc20x table 4-59: porta register map for pic24epxxxgp/mc202 and dspic33epxxxgp/mc 202/502 devices only table 4-60: portb register map for pic24epxxxgp/ mc202 and dspic33epxxxgp/ mc202/502 devices only file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trisa 0e00 ? ? ? ? ? ? ? ? ? ? ? trisa4trisa3trisa2trisa1trisa0 001c porta 0e02 ? ? ? ? ? ? ? ? ? ? ? ra4 ra3 ra2 ra1 ra0 0000 lata 0e04 ? ? ? ? ? ? ? ? ? ? ? lata4 lata3 lata2 la1ta1 la0ta0 0000 odca 0e06 ? ? ? ? ? ? ? ? ? ? ? odca4 odca3 odca2 odca1 odca0 0000 cnena 0e08 ? ? ? ? ? ? ? ? ? ? ? cniea4 cniea3 cni ea2 cniea1 cniea0 0000 cnpua 0e0a ? ? ? ? ? ? ? ? ? ? ? cnpua4 cnpua3 cnpua2 cnpua1 cnpua0 0000 cnpda 0e0c ? ? ? ? ? ? ? ? ? ? ? cnpda4 cnpda3 cnpda2 cnpda1 cnpda0 0000 ansela 0e0e ? ? ? ? ? ? ? ? ? ? ?ansa4 ? ? ansa1 ansa0 0013 legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trisb 0e10 trisb15 trisb14 trisb13 trisb12 trisb11 trisb10 trisb9 trisb8 trisb7 trisb6 trisb5 trisb4 trisb3 trisb2 trisb1 trisb0 ffff portb 0e12 rb15 rb14 rb13 rb12 rb11 rb10 rb9 rb8 rb7 rb6 rb5 rb4 rb3 rb2 rb1 rb0 xxxx latb 0e14 latb15 latb14 latb13 latb12 latb11 latb10 latb9 latb8 latb7 latb6 latb5 latb4 latb3 latb2 latb1 latb0 xxxx odcb 0e16 odcb15 odcb14 odcb13 odcb 12 odcb11 odcb10 odcb9 odcb8 odcb7 o dcb6 odcb5 odcb4 odcb3 odcb2 odcb1 odcb0 0000 cnenb 0e18 cnieb15 cnieb14 cnieb13 cnieb12 cnieb11 cnieb10 cni eb9 cnieb8 cnieb7 cnieb6 cnieb5 cnieb4 cnieb3 cnieb2 cnieb1 cnieb0 0000 cnpub 0e1a cnpub15 cnpub14 cnpub13 cnpub12 cnpub11 cnpub10 cnpub9 cnpub8 cnpub7 cnpub6 cnpub5 cnpub 4 cnpub3 cnpub2 cnpub1 cnpub0 0000 cnpdb 0e1c cnpdb15 cnpdb14 cnpdb13 cnpdb12 cnpdb11 cnpdb10 cnpdb9 cnpdb8 cnpdb7 cnpdb6 cnpdb5 cnpdb 4 cnpdb3 cnpdb2 cnpdb1 cnpdb0 0000 anselb 0e1e ? ? ? ? ? ? ?ansb8 ? ? ? ? ansb3 ansb2 ansb1 ansb0 010f legend: x = unknown value on reset, ? = unimplemented, read as ? 0 ?. reset values are shown in hexadecimal.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 98 preliminary ? 2011 microchip technology inc. 4.4.1 paged memory scheme the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/ 50x, and pic24epxxxgp/mc20x architecture extends the available dat a space through a paging scheme, which allows the available data space to be accessed using mov instructions in a linear fashion for pre- and post-modified effective addresses (ea). the upper half of base data space address is used in conjunction with the data space page registers, the 10-bit read page register (dsrpag) or the 9-bit write page register (dswpag), to form an extended data space (eds) address or program space visibility (psv) address. the data space page registers are located in the sfr space. construction of the eds address is shown in figure 4-1 . when dsrpag<9> = 0 and base address bit ea<15> = 1 , dsrpag<8:0> is concatenated onto ea<14:0> to form the 24-bit eds read address. similarly when base address bit ea<15> = 1 , dswpag<8:0> is concat enated onto ea<14:0> to form the 24-bit eds write address. example 4-1: extended data space (eds) read address generation 1 dsrpag<8:0> 9 bits ea 15 bits select byte 24-bit eds ea select ea (dsrpag = don't care) no eds access select 16-bit ds ea byte ea<15> = 0 dsrpag 0 ea<15> note: ds read access when dsrpag = 0x 000 will force an address error trap. = 1 ? dsrpag<9> y n generate psv address 0 dsrpag<9>
? 2011 microchip technology inc. preliminary ds70657d-page 99 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x example 4-2: extended data space (eds) write address generation the paged memory scheme provides access to multiple 32-kbyte windows in the eds and psv memory. the data space page registers dsxpag, in combination with the upper ha lf of data space address can provide up to 16 mbytes of additional address space in the eds and 8 mbytes (dsrpag only) of psv address space. the paged data memory space is shown in example 4-3 . the program space (ps) can be accessed with dsrpag of 0x200 or greater. only reads from ps are supported using the dsrpag. writes to ps are not supported, so dswpag is dedicated to ds, including eds, only. the data space and eds can be read from and written to using dsrpag and dswpag, respectively. 1 dswpag<8:0> 9 bits ea 15 bits byte 24-bit eds ea select ea (dswpag = don't care) no eds access select 16-bit ds ea byte ea<15> = 0 ea<15> note: ds read access when dsrpag = 0x00 0 will force an address error trap. generate psv address 0
DSPIC33EPXXXGP50X, dspic33epxxxm c20x/50x, and pi c24epxxxgp/mc20x ds70657d-page 100 preliminary ? 2011 microchip technology inc. example 4-3: paged data memory space 0x0000 program memory 0x0000 0x7fff 0x7fff eds page 0x001 0x0000 sfr registers 0x0fff 0x1000 up to 8 kbyte 0x2fff local data space eds (dsrpag<9:0>/dswpag<8:0>) reserved (will produce an address error trap) 32 kbyte eds window 0xffff 0x3000 page 0 program space 0x00_0000 0x7f_ffff (lsw - <15:0>) 0x0000 (dsrpag = 0x001) (dswpag = 0x001) eds page 0x1ff (dsrpag = 0x1ff) (dswpag = 0x1ff) eds page 0x200 (dsrpag = 0x200) psv program memory eds page 0x2ff (dsrpag = 0x2ff) eds page 0x300 (dsrpag = 0x300) eds page 0x3ff (dsrpag = 0x3ff) 0x7fff 0x0000 0x7fff 0x0000 0x7fff 0x0000 0x7fff 0x0000 0x7fff ds_addr<14:0> ds_addr<15:0> (lsw) psv program memory (msb) table address space (tblpag<7:0>) program memory 0x00_0000 0x7f_ffff (msb - <23:16>) 0x0000 (tblpag = 0x00) 0xffff ds_addr<15:0> lsw using tblrdl/tblwtl msb using tblrdh/tblwth 0x0000 (tblpag = 0x7f) 0xffff lsw using tblrdl/tblwtl msb using tblrdh/tblwth (instruction & data) no writes allowed no writes allowed no writes allowed no writes allowed ram 0x7fff 0x8000
? 2011 microchip technology inc. preliminary ds70657d-page 101 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x allocating different page re gisters for read and write access allows the architecture to support data movement between different pages in data memory. this is accomplished by setting the dsrpag register value to the page from which you want to read, and configuring the dswpag regist er to the page to which it needs to be written. data can also be moved from different psv to eds page s, by configuring the dsrpag and dswpag registers to address psv and eds space, respectively. the data can be moved between pages by a single instruction. when an eds or psv page overflow or underflow occurs, ea<15> is cleared as a result of the register indirect ea calculation. an overflow or underflow of the ea in the eds or psv pages can occur at the page boundaries when: ? the initial address prior to modification addresses an eds or psv page ? the ea calculation uses pre- or post-modified register indirect addressing. however, this does not include register offset addressing in general, when an overflow is detected, the dsxpag register is incremented, and the ea<15> bit is set to keep the base address within the eds or psv window. when an underflow is detect ed, the dsxpag register is decremented, and the ea<15> bit is set to keep the base address within th e eds or psv window. this creates a linear eds and psv address space, but only when using register indirect addressing modes. exceptions to the operation described above arise when entering and exiting the boundaries of page 0, eds, and psv spaces. ta b l e 4 - 6 1 lists the effects of overflow and underflow scenarios at different boundaries. in the following cases, when overflow or underflow occurs, the ea<15> bit is set and the dsxpag is not modified; therefore, the ea will wrap to the beginning of the current page: ? register indirect with r egister offset addressing ? modulo addressing ? bit-reversed addressing table 4-61: overflow and underflow scenar ios at page 0, eds, and psv space boundaries o/u, r/w operation before after dsxpag ds ea<15> page description dsxpag ds ea<15> page description o, read [++wn] or [wn++] dsrpag = 0x1ff 1 eds: last page dsrpag = 0x1ff 0 see note 1 o, read dsrpag = 0x2ff 1 psv: last lsw page dsrpag = 0x300 1 psv: first msb page o, read dsrpag = 0x3ff 1 psv: last msb page dsrpag = 0x3ff 0 see note 1 o, write dswpag = 0x1ff 1 eds: last page dswpag = 0x1ff 0 see note 1 u, read [--wn] or [wn--] dsrpag = 0x001 1 psv page dsrpag = 0x001 0 see note 1 u, read dsrpag = 0x200 1 psv: first lsw page dsrpag = 0x200 0 see note 1 u, read dsrpag = 0x300 1 psv: first msb page dsrpag = 0x2ff 1 psv: last lsw page legend: o = overflow, u = underflow, r = read, w = write note 1: the register indirect address now addresses a loca tion in the base data space (0x0000-0x8000). 2: an eds access with dsxpag = 0x000 will generate an address error trap. 3: only reads from ps are supported using dsrpag. an attempt to write to ps using dswpag will generate an address error trap. 4: pseudo-linear addressing is not supported for large offsets.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 102 preliminary ? 2011 microchip technology inc. 4.4.2 extended x data space the lower portion of the base address space range between 0x0000 and 0x2fff is always accessible regardless of the contents of the data space page registers. it is indirectly addressable through the register indirect instructions. it can be regarded as being located in the default eds page 0 (i.e., eds address range of 0x000000 to 0x002fff with the base address bit ea<15> = 0 for this address range). however, page 0 cannot be accessed through upper 32 kbytes, 0x8000 to 0xffff, of base data space in combination with dsrpag = 0x00 or dswpag = 0x00. consequently, dsrpag and dswpag are initialized to 0x001 at reset. the remaining pages including both eds and psv pages are only accessible using the dsrpag or dswpag registers in combination with the upper 32 kbytes, 0x8000 to 0xffff, of the base address, where base address bit ea<15> = 1 . for example, when dsrpag = 0x01 or dswpag = 0x01, accesses to the upper 32 kbytes, 0x8000 to 0xffff, of the data space will map to the eds address range of 0x008000 to 0x00ffff. when dsrpag = 0x02 or dswpag = 0x02, accesses to the upper 32 kbytes of the data space will map to the eds address range of 0x010000 to 0x017fff and so on, as shown in the eds memory map in figure 4-14 . for more information of the psv page access using data space page registers refer to 4.5 ?program space visibility from data space? in section 4. ?program memory? (ds70613) of the ?dspic33e/ pic24e family reference manual? . figure 4-14: eds memory map note 1: dsxpag should not be used to access page 0. an eds access with dsxpag set to 0x000 will generate an address error trap. 2: clearing the dsxpag in software has no effect. 0x008000 0x010000 0x018000 page 3 page 2 page 1fd 0xfe8000 0xff0000 0xff8000 page 1ff page 1fe sfr/ds 0x0000 0xffff eds ea address (24-bits) ds conventional ea<15:0> 0x8000 (page 0) (dsrpag<8:0>, ea<14:0>) (dswpag<8:0>, ea<14:0>) page 1 dsrpag<9> = 0 ds address
? 2011 microchip technology inc. preliminary ds70657d-page 103 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 4.4.3 data memory arbitration and bus master priority eds accesses from bus masters in the system are arbitrated. the arbiter for data memory (including eds) arbitrates between the cpu, the dma, and the icd module. in the event of coincidental access to a bus by the bus masters, the arbiter determines which bus master access has the highest priority. the other bus masters are suspended and processed after the access of the bus by the bus master with the highest priority. by default, the cpu is bus master 0 (m0) with the highest priority, and the icd is bus master 4 (m4) with the lowest priority. the remaining bus masters (dma controllers) are allocated to m2 and m3, respectively (m1 is reserved and cannot be used). the user application may raise or lower the priority of the masters to be above that of the cpu by setting the appropriate bits in the eds bus master priority control (mstrpr) register. all bus masters with raised priorities will maintain the same priority relationship relative to each other (i.e., m1 being highest and m3 being lowest with m2 in between). also, all the bus masters with priorities below that of the cpu maintain the same priority relationship relative to each other. the priority schemes for bus masters with different mstrpr values are tabulated in table 4-62 . this bus master priority control allows the user application to manipulate the real-time response of the system, either statically during initia lization, or dynamically in response to real-time events. table 4-62: data memory bus arbiter priority note 1: all other values of mstrpr<15:0> are reserved. figure 4-15: arbiter architecture priority mstrpr<15:0> bit setting (1) 0x0000 0x0008 0x0020 0x0028 m0 (highest) cpu reserved dma reserved m1 reserved cpu cpu dma m2 reserved reserved reserved cpu m3 dma dma reserved reserved m4 (lowest) icd icd icd icd icd reserved data memory arbiter m0 m1 m2 m3 m4 mstrpr<15:0> dma cpu sram
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 104 preliminary ? 2011 microchip technology inc. 4.4.4 software stack the w15 register serves as a dedicated software stack pointer (sp) and is automatic ally modified by exception processing, subroutine calls and returns; however, w15 can be referenced by any instruction in the same manner as all other w registers. this simplifies reading, writing and manipulating of the stack pointer (for example, creating stack frames). w15 is initialized to 0x1000 during all resets. this address ensures that the sp points to valid ram in all DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x devices and permits stack availability for non-maskable trap exceptions. these can occur before the sp is initialized by the user software. you can reprogram the sp during initialization to any location within data space. the stack pointer always points to the first available free word and fills the software stack working from lower toward higher addresses. figure 4-16 illustrates how it pre-decrements for a stack pop (read) and post- increments for a stack push (writes). when the pc is pushed onto the stack, pc<15:0> is pushed onto the first available stack word, then pc<22:16> is pushed into the second available stack location. for a pc push during any call instruction, the msb of the pc is zero-extended before the push, as shown in figure 4-16 . during exception processing, the msb of the pc is conc atenated with the lower 8 bits of the cpu status register, sr. this allows the contents of srl to be preserved automatically during interrupt processing. figure 4-16: call stack frame 4.5 instruction addressing modes the addressing modes shown in table 4-63 form the basis of the addressing modes optimized to support the specific features of i ndividual instructions. the addressing modes provided in the mac class of instructions differ from th ose in the other instruction types. 4.5.1 file register instructions most file register instructions use a 13-bit address field (f) to directly address data present in the first 8192 bytes of data memory (near data space). most file register instructions employ a working register, w0, which is denoted as wreg in these instructions. the destination is typically either the same file register or wreg (with the exception of the mul instruction), which writes the result to a register or register pair. the mov instruction allows additional flexibility and can access the entire data space. 4.5.2 mcu instructions the three-operand mcu instru ctions are of the form: operand 3 = operand 1 operand 2 where operand 1 is always a working register (that is, the addressing mode can only be register direct), which is referred to as wb. operand 2 can be a w reg- ister, fetched from data memory, or a 5-bit literal. the result location can be either a w register or a data memory location. the following addressing modes are supported by mcu instructions: ? register direct ? register indirect ? register indirect post-modified ? register indirect pre-modified ? 5-bit or 10-bit literal note: to protect against misaligned stack accesses, w15<0> is fixed to ? 0 ? by the hardware. note 1: to maintain system stack pointer (w15) coherency, w15 is never subject to (eds) paging, and is therefore restricted to an address range of 0x0000 to 0xffff. the same applies to the w14 when used as a stack frame pointer (sfa = 1 ). 2: as the stack can be placed in, and can access, x and y spaces, care must be taken regarding its use, particularly with regard to local automatic variables in a c development environment note: not all instructions support all the addressing modes given above. individ- ual instructions can support different subsets of these addressing modes. pc<15:1> b?000000000? 0 15 w15 (before call ) w15 (after call ) stack grows toward higher address 0x0000 pc<22:16> call subr
? 2011 microchip technology inc. preliminary ds70657d-page 105 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x table 4-63: fundamental addressing modes supported 4.5.3 move and accumulator instructions move instructions, which apply to DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x devices, and the dsp accumulator class of instructions, which apply to the dspic33epxxxmc20x/50x and DSPIC33EPXXXGP50X devices, provide a greater degree of addressing flexibilit y than other instructions. in addition to the addressing modes supported by most mcu instructions, move and accumulator instructions also support register indirect with register offset addressing mode, also referred to as register indexed mode. in summary, the following addressing modes are supported by move and accumulator instructions: ? register direct ? register indirect ? register indirect post-modified ? register indirect pre-modified ? register indirect with register offset (indexed) ? register indirect with literal offset ? 8-bit literal ? 16-bit literal 4.5.4 mac instructions (dspic33epxxxmc20x/50x and DSPIC33EPXXXGP50X devices only) the dual source operand dsp instructions ( clr , ed , edac , mac , mpy , mpy.n , movsac and msc ), also referred to as mac instructions, use a si mplified set of addressing modes to allow the user application to effectively manipulate the data pointers through register indirect tables. the two-source operand pref etch registers must be members of the set {w8, w9, w10, w11}. for data reads, w8 and w9 are always directed to the x ragu, and w10 and w11 are always directed to the y agu. the effective addresses generated (before and after modification) must, therefore, be valid addresses within x data space for w8 and w9 and y data space for w10 and w11. in summary, the following addressing modes are supported by the mac class of instructions: ? register indirect ? register indirect post-modified by 2 ? register indirect post-modified by 4 ? register indirect post-modified by 6 ? register indirect with register offset (indexed) 4.5.5 other instructions besides the addressing modes outlined previously, some instructions use literal cons tants of various sizes. for example, bra (branch) instructions use 16-bit signed literals to specify the branch destination directly, whereas the disi instruction uses a 14-bit unsigned literal field. in some instructions, such as ulnk , the source of an operand or result is implied by the opcode itself. certain operations, such as nop , do not have any operands. addressing mode description file register direct the address of the file register is specified explicitly. register direct the contents of a register are accessed directly. register indirect the contents of wn forms the effective address (ea). register indirect post-modified the contents of wn forms the ea. wn is post-modified (incremented or decremented) by a constant value. register indirect pre-modified wn is pre-modified (inc remented or decremented) by a signed constant value to form the ea. register indirect with register offset (register indexed) the sum of wn and wb forms the ea. register indirect with literal offset the sum of wn and a literal forms the ea. note: for the mov instructions, the addressing mode specified in the instruction can differ for the source and destination ea. however, the 4-bit wb (register offset) field is shared by both source and destination (but typically only used by one). note: not all instructions support all the addressing modes given above. individual instructions may support different subsets of these addressing modes. note: register indirect with register offset addressing mode is available only for w9 (in x space) and w11 (in y space).
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 106 preliminary ? 2011 microchip technology inc. 4.6 modulo addressing (dspic33epxxxmc20x/50x and DSPIC33EPXXXGP50X devices only) modulo addressing mode is a method of providing an automated means to support circular data buffers using hardware. the objective is to remove the need for software to perform data address boundary checks when executing tightly looped code, as is typical in many dsp algorithms. modulo addressing can operate in either data or program space (since the data point er mechanism is essentially the same for both). one circ ular buffer can be supported in each of the x (which also provides the pointers into program space) and y data spaces. modulo addressing can operate on any w register pointer. however, it is not advisable to use w14 or w15 for modulo addressing since these two registers ar e used as the stack frame pointer and stack pointer, respectively. in general, any particular circular buffer can be config- ured to operate in only one direction as there are certain restrictions on the bu ffer start address (for incre- menting buffers), or end address (for decrementing buffers), based upon the direction of the buffer. the only exception to the usage restrictions is for buffers that have a power-of-two length. as these buffers satisfy the start and end address criteria, they can operate in a bidirectional mode (that is, address boundary checks are performe d on both the lower and upper address boundaries). 4.6.1 start and end address the modulo addressing scheme requires that a starting and ending address be specified and loaded into the 16-bit modulo buffer address registers: xmodsrt, xmodend, ymodsrt and ymodend (see ta b l e 4 - 1 ). the length of a circular buffer is not directly specified. it is determined by the difference between the corresponding start and end addresses. the maximum possible length of the circular buffer is 32k words (64 kbytes). 4.6.2 w address register selection the modulo and bit-reversed addressing control register, modcon<15:0>, contains enable flags as well as a w register field to sp ecify the w address registers. the xwm and ywm fields select the registers that operate with modulo addressing: ?if xwm = 1111 , x ragu and x wagu modulo addressing is disabled ?if ywm = 1111 , y agu modulo addressing is disabled the x address space pointer w register (xwm), to which modulo addressing is to be applied, is stored in modcon<3:0> (see table 4-1 ). modulo addressing is enabled for x data space when xwm is set to any value other than ? 1111 ? and the xmoden bit is set at modcon<15>. the y address space pointer w register (ywm) to which modulo addressing is to be applied is stored in modcon<7:4>. modulo addressing is enabled for y data space when ywm is set to any value other than ? 1111 ? and the ymoden bit is set at modcon<14>. figure 4-17: modulo addr essing operation example note: y space modulo addressing ea calcula- tions assume word-sized data (lsb of every ea is always clear). 0x1100 0x1163 start addr = 0x1100 end addr = 0x1163 length = 0x0032 words byte address mov #0x1100, w0 mov w0, xmodsrt ;set modulo start address mov #0x1163, w0 mov w0, modend ;set modulo end address mov #0x8001, w0 mov w0, modcon ;enable w1, x agu for modulo mov #0x0000, w0 ;w0 holds buffer fill value mov #0x1110, w1 ;point w1 to buffer do again, #0x31 ;fill the 50 buffer locations mov w0, [w1++] ;fill the next location again: inc w0, w0 ;increment the fill value
? 2011 microchip technology inc. preliminary ds70657d-page 107 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 4.6.3 modulo addressing applicability modulo addressing can be applied to the effective address (ea) calculation associated with any w register. address boundaries check for addresses equal to: ? the upper boundary addresses for incrementing buffers ? the lower boundary addresses for decrementing buffers it is important to realize that the address boundaries check for addresses less than or greater than the upper (for incrementing buffers) and lower (for decrementing buffers) boundary addresses (not just equal to). address changes can, therefore, jump beyond boundaries and still be adjusted correctly. 4.7 bit-reversed addressing (dspic33epxxxmc20x/50x and DSPIC33EPXXXGP50X devices only) bit-reversed addressing mode is intended to simplify data reordering for radix-2 fft algorithms. it is supported by the x agu for data writes only. the modifier, which can be a constant value or register contents, is regarded as having its bit order reversed. the address source and destination are kept in normal order. thus, the only operand requiring reversal is the modifier. 4.7.1 bit-reversed addressing implementation bit-reversed addressing mode is enabled in any of these situations: ? bwm bits (w register selection) in the modcon register are any value other than ? 1111 ? (the stack cannot be accessed using bit-reversed addressing) ? the bren bit is set in the xbrev register ? the addressing mode used is register indirect with pre-increment or post-increment if the length of a bit-reversed buffer is m = 2 n bytes, the last ?n? bits of the data buffer start address must be zeros. xb<14:0> is the bit-reversed address modifier, or ?pivot point,? which is typica lly a constant. in the case of an fft computation, its value is equal to half of the fft data buffer size. when enabled, bit-reversed addressing is executed only for register indirect with pre-increment or post- increment addressing and word-sized data writes. it does not function for any other addressing mode or for byte-sized data, and normal addresses are generated instead. when bit-reversed ad dressing is active, the w address pointer is always added to the address modifier (xb), and the offset associated with the register indirect addressing mode is ignored. in addition, as word-sized data is a requirement, the lsb of the ea is ignored (and always clear). if bit-reversed addressing has already been enabled by setting the bren (xbrev<15>) bit, a write to the xbrev register should not be immediately followed by an indirect read operation using the w register that has been designated as the bit-reversed pointer. note: the modulo corrected effective address is written back to the register only when pre- modify or post-modify addressing mode is used to compute the effective address. when an address offset (such as [w7 + w2]) is used, modulo address correction is performed but the contents of the register remain unchanged. note: all bit-reversed ea calculations assume word-sized data (lsb of every ea is always clear). the xb value is scaled accordingly to generate compatible (byte) addresses. note: modulo addressing and bit-reversed addressing can be enabled simultaneously using the same w register, but bit-reversed addressing operation will always take precedence for data writes when enabled.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 108 preliminary ? 2011 microchip technology inc. figure 4-18: bit-reversed address example table 4-64: bit-reversed address sequence (16-entry) normal address bit-reversed address a3 a2 a1 a0 decimal a3 a2 a1 a0 decimal 0000 0 0000 0 0001 1 1000 8 0010 2 0100 4 0011 3 1100 12 0100 4 0010 2 0101 5 1010 10 0110 6 0110 6 0111 7 1110 14 1000 8 0001 1 1001 9 1001 9 1010 10 0101 5 1011 11 1101 13 1100 12 0011 3 1101 13 1011 11 1110 14 0111 7 1111 15 1111 15 b3 b2 b1 0 b2 b3 b4 0 bit locations swapped left-to-right around center of binary value bit-reversed address xb = 0x0008 for a 16-word bit-reversed buffer b7 b6 b5 b1 b7 b6 b5 b4 b11 b10 b9 b8 b11 b10 b9 b8 b15 b14 b13 b12 b15 b14 b13 b12 sequential address pivot point
? 2011 microchip technology inc. preliminary ds70657d-page 109 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 4.8 interfacing program and data memory spaces the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/ 50x, and pic24epxxxgp/mc20 x architecture uses a 24-bit-wide program space and a 16-bit-wide data space. the architecture is also a modified harvard scheme, meaning that data ca n also be present in the program space. to use this data successfully, it must be accessed in a way that preserves the alignment of information in both spaces. aside from normal execution, the architecture of the DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x devices provides two methods by which program space can be accessed during operation: ? using table instructions to access individual bytes or words anywhere in the program space ? remapping a portion of the program space into the data space (program space visibility) table instructions allow an application to read or write to small areas of the program memory. this capability makes the method ideal for accessing data tables that need to be updated periodically. it also allows access to all bytes of the program word. the remapping method allows an application to access a large block of data on a read-only basis, which is ideal for look-ups from a large table of static data. the application can only access the least signif icant word of the program word. table 4-65: program space address construction figure 4-19: data acc ess from program spac e address generation access type access space program space address <23> <22:16> <15> <14:1> <0> instruction access (code execution) user 0 pc<22:1> 0 0xx xxxx xxxx xxxx xxxx xxx0 tblrd/tblwt (byte/word read/write) user tblpag<7:0> data ea<15:0> 0xxx xxxx xxxx xxxx xxxx xxxx configuration tblpag<7:0> data ea<15:0> 1xxx xxxx xxxx xxxx xxxx xxxx 0 program counter 23 bits program counter (1) tblpag 8 bits ea 16 bits byte select 0 1/0 user/configuration table operations (2) space select 24 bits 1/0 note 1: the least significant bit (lsb) of program space addresses is always fixed as ? 0 ? to maintain word alignment of data in the program and data spaces. 2: table operations are not required to be word aligned. table read operations are permitted in the configuration memory space.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 110 preliminary ? 2011 microchip technology inc. 4.8.1 data access from program memory using table instructions the tblrdl and tblwtl instructions offer a direct method of reading or writing the lower word of any address within the program space without going through data space. the tblrdh and tblwth instructions are the only me thod to read or write the upper 8 bits of a program space word as data. the pc is incremented by two for each successive 24-bit program word. this allows program memory addresses to directly map to data space addresses. program memory can thus be regarded as two 16-bit- wide word address spaces, residing side by side, each with the same address range. tblrdl and tblwtl access the space that contains the least significant data word. tblrdh and tblwth access the space that contains the upper data byte. two table instructions are provided to move byte or word-sized (16-bit) data to and from program space. both function as either byte or word operations. ? tblrdl (table read low): - in word mode, this instruction maps the lower word of the program space location (p<15:0>) to a data address (d<15:0>) - in byte mode, either the upper or lower byte of the lower program word is mapped to the lower byte of a data address. the upper byte is selected when byte select is ? 1 ?; the lower byte is selected when it is ? 0 ?. ? tblrdh (table read high): - in word mode, this instruction maps the entire upper word of a program address (p<23:16>) to a data address. the ?phantom? byte (d<15:8>), is always ? 0 ?. - in byte mode, this inst ruction maps the upper or lower byte of the program word to d<7:0> of the data address, in the tblrdl instruc- tion. the data is always ? 0 ? when the upper ?phantom? byte is selected (byte select = 1 ). in a similar fashion, two table instructions, tblwth and tblwtl , are used to write individual bytes or words to a program space address. the details of their operation are explained in section 5.0 ?flash program memory? . for all table operations, the area of program memory space to be accessed is determined by the table page register (tblpag). tblpag covers the entire program memory space of the device, including user application and configuration spaces. when tblpag<7> = 0 , the table page is located in the user memory space. when tblpag<7> = 1 , the page is located in configuration space. figure 4-20: accessing program memory with table instructions 0 8 16 23 00000000 00000000 00000000 00000000 ?phantom? byte tblrdh.b (wn<0> = 0 ) tblrdl.w tblrdl.b (wn<0> = 1 ) tblrdl.b (wn<0> = 0 ) 23 15 0 tblpag 02 0x000000 0x800000 0x020000 0x030000 program space the address for the table operation is determined by the data ea within the page defined by the tblpag register. only read operations are shown; write operations are also valid in the user memory area
? 2011 microchip technology inc. preliminary ds70657d-page 111 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 5.0 flash program memory the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/ 50x, and pic24epxxxgp/mc 20x devices contain internal flash program memory for storing and executing application code . the memory is readable, writable and erasable during normal operation over the entire v dd range. flash memory can be programmed in two ways: ? in-circuit serial programming? (icsp?) programming capability ? run-time self-programming (rtsp) icsp allows for a DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/ mc20x device to be serially programmed while in the end application circuit. this is done with two lines for programming clock and programming data (one of the alternate programming pin pairs: pgecx/pgedx), and three other lines for power (v dd ), ground (v ss ) and master clear (mclr ). this allows customers to manufacture boards with unprogrammed devices and then program the device just before shipping the product. this also allows the most recent firmware or a custom firmware to be programmed. rtsp is accomplished using tblrd (table read) and tblwt (table write) instructions. with rtsp, the user application can write program memory data a single program memory word, and erase program memory in blocks or ?pages? of 1024 instructions (3072 bytes) at a time. 5.1 table instructions and flash programming regardless of the method used, all programming of flash memory is done with the table read and table write instructions. these al low direct read and write access to the program memory space from the data memory while the device is in normal operating mode. the 24-bit target address in the program memory is formed using bits <7:0> of the tblpag register and the effective address (ea) from a w register specified in the table instruction, as shown in figure 5-1 . the tblrdl and the tblwtl instructions are used to read or write to bits <15:0> of program memory. tblrdl and tblwtl can access program memory in both word and byte modes. the tblrdh and tblwth instructions are used to read or write to bits <23:16> of program memory. tblrdh and tblwth can also access program memory in word or byte mode. figure 5-1: addressing for table registers note 1: this data sheet summ arizes the features of the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x families of devices. it is not intended to be a compre- hensive reference source. to comple- ment the information in this data sheet, refer to section 5. ?flash program- ming? (ds70609) of the ?dspic33e/ pic24e family reference manual? , which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for de vice-specific register and bit information. 0 program counter 24 bits program counter tblpag reg 8 bits working reg ea 16 bits byte 24-bit ea 0 1/0 select using table instruction using user/configuration space select
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 112 preliminary ? 2011 microchip technology inc. 5.2 rtsp operation rtsp allows the user application to erase a single page of memory, and to pr ogram two instruction words at a time. see the general purpose and motor control family tables (table 1 and table 2 , respectively) for the page sizes of each device. for more information on erasing and programming flash memory, refer to section 5. ?flash program- ming? (ds70609) in the ?dspic33e/pic24e family reference manual? . 5.3 programming operations a complete programming sequence is necessary for programming or erasing the internal flash in rtsp mode. the processor stalls (waits) until the programming operation is finished. for erase and program times, refer to parameters di37a and di37b (page erase time), and di38a and di38b (word write cycle time), in table 30-13: ?dc characteristics: program memory? . setting the wr bit (nvmcon<15>) starts the opera- tion, and the wr bit is automatically cleared when the operation is finished. 5.3.1 programming algorithm for flash program memory programmers can program two adjacent words (24 bits x 2) of program flash memory at a time on every other word address boundary (0x000002, 0x000006, 0x00000a, etc.). to do this, it is necessary to erase page that contains the desired address of the location the user wants to change. for protection against accide ntal operations, the write initiate sequence for nvm key must be used to allow any erase or program operat ion to proceed. after the programming command has been executed, the user application must wait for the programming time until programming is complete. the two instructions follow- ing the start of the programming sequence should be nop s. refer to section 5. ?flash programming? (ds70609) in the ? dspic33e/pic24e family reference manual ? for details and codes examples on programming using rtsp. 5.4 flash memory resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 5.4.1 key resources ? section 5. ?flash programming? (ds70609) ? code samples ? application notes ? software libraries ? webinars ? all related dspic33e/pic24e family reference manuals sections ? development tools 5.5 control registers four sfrs are used to read and write the program flash memory: nvmcon, nvmkey, nvmadru, and nvmadr. the nvmcon register ( register 5-1 ) controls which blocks are to be erased, which memory type is to be programmed and the start of the programming cycle. nvmkey ( register 5-4 ) is a write-only register that is used for write protection. to start a programming or erase sequence, the user application must consecutively write 0x55 and 0xaa to the nvmkey register. there are two nvm address registers: nvmadru and nvmadr. these two registers, when concatenated, form the 24-bit effective address (ea) of the selected row or word for programming operations, or the selected page for erase operations. the nvmadru register is used to hold the upper 8 bits of the ea, while the nvmadr register is used to hold the lower 16 bits of the ea. note: in the event you are not able to access the product page using the link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
? 2011 microchip technology inc. preliminary ds70657d-page 113 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 5-1: nvmcon: nonvolatil e memory (nvm) control register r/so-0 (1) r/w-0 (1) r/w-0 (1) r/w-0 u-0 u-0 u-0 u-0 wr wren wrerr nvmsidl (2) ? ? ? ? bit 15 bit 8 u-0 u-0 u-0 u-0 r/w-0 (1) r/w-0 (1) r/w-0 (1) r/w-0 (1) ? ? ? ?nvmop<3:0> (3,4) bit 7 bit 0 legend: so = settable only bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 wr: write control bit 1 = initiates a flash memory program or erase operat ion. the operation is self-timed and the bit is cleared by hardware once operation is complete 0 = program or erase operation is complete and inactive bit 14 wren: write enable bit 1 = enable flash program/erase operations 0 = inhibit flash program/erase operations bit 13 wrerr: write sequence error flag bit 1 = an improper program or erase sequence attempt or termination has occurred (bit is set automatically on any set attempt of the wr bit) 0 = the program or erase operation completed normally bit 12 nvmsidl: nvm stop-in-idle control bit (2) 1 = discontinue flash operation when the device enters idle mode 0 = continue flash operation when the device enters idle mode bit 11-4 unimplemented: read as ? 0 ? bit 3-0 nvmop<3:0>: nvm operation select bits (3,4) 1111 = reserved 1110 = reserved 1101 = reserved 1100 = reserved 1011 = reserved 1010 = reserved 0011 = memory page erase operation 0010 = reserved 0001 = memory double-word program operation (5) 0000 = reserved note 1: these bits can only be reset on por. 2: if this bit is set, there will be minimal power savings (i idle ), and upon exiting idle mode there is a delay (tvreg) before flash memory becomes operational. 3: all other combinations of nv mop<3:0> are unimplemented. 4: execution of the pwrsav instruction is ignored while any of the nvm operations are in progress. 5: two adjacent words on a 4-word boundary are programmed during execution of this operation.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 114 preliminary ? 2011 microchip technology inc. register 5-4: nvmkey: nonvolatile memory key register register 5-2: nvmadru: nonvolat ile memory upper address register u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x nvmadru<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-8 unimplemented: read as ? 0 ? bit 7-0 nvmadru<7:0>: non-volatile memory upper write address bits selects the upper 8 bits of the location to progra m or erase in program flash memory. this register may be read or written by the user application. register 5-3: nvmadr: nonvolatil e memory lower address register r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x nvmadr<15:8> bit 15 bit 8 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x nvmadr<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 nvmadr<15:0>: non-volatile memory lower write address bits selects the lower 16 bits of the location to program or erase in program flash memory. this register may be read or written by the user application. u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 w-0 w-0 w-0 w-0 w-0 w-0 w-0 w-0 nvmkey<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-8 unimplemented: read as ? 0 ? bit 7-0 nvmkey<7:0>: key register (w rite-only) bits
? 2011 microchip technology inc. preliminary ds70657d-page 115 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 6.0 resets the reset module combines all reset sources and controls the device mast er reset signal, sysrst . the following is a list of device reset sources: ? por: power-on reset ? bor: brown-out reset ?mclr : master clear pin reset ?swr: reset instruction ? wdto: watchdog timer reset ? cm: configuration mismatch reset ? trapr: trap conflict reset ? iopuwr: illegal condition device reset - illegal opcode reset - uninitialized w register reset - security reset a simplified block diagram of the reset module is shown in figure 6-1 . any active source of reset will make the sysrst sig- nal active. on system reset, some of the registers associated with the cpu and peripherals are forced to a known reset state and some are unaffected. all types of device reset sets a corresponding status bit in the rcon register to indicate the type of reset (see register 6-1 ). a por clears all the bits, except for the por and bor bits (rcon<1:0>), that are set. the user application can set or clear any bit at any time during code execution. the rcon bits only serve as status bits. setting a particular reset status bit in software does not cause a device reset to occur. the rcon register also has other bits associated with the watchdog timer and device power-saving states. the function of these bits is discussed in other sections of this manual. there are two types of reset, a cold reset and a warm reset. a cold reset is the result of a por or bor and the fnosc configuration bits in the fosc device configuration register select the device clock source. a warm reset is the result of all other resets including the reset instruction and the current oscillator selec- tion bits (cosc<2:0>) in the oscillator control register (osccon<14:12>) select the clock source. figure 6-1: reset system block diagram note 1: this data sheet summ arizes the features of the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x families of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to section 8. ?reset? (ds70602) of the ?dspic33e/pic24e family reference manual? , which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for de vice-specific register and bit information. note: refer to the specific peripheral section or section 4.0 ?memory organization? of this manual for register reset states. note: the status bits in the rcon register should be cleared after they are read so that the next rcon register value after a device reset is meaningful. mclr v dd internal regulator bor sleep or idle reset instruction wdt module glitch filter trap conflict illegal opcode uninitialized w register sysrst v dd rise detect por configuration mismatch security reset
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 116 preliminary ? 2011 microchip technology inc. 6.1 reset resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 6.1.1 key resources ? section 8. ?reset? (ds70602) ? code samples ? application notes ? software libraries ? webinars ? all related dspic33e/pic24e family reference manuals sections ? development tools note: in the event you are not able to access the product page using t he link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
? 2011 microchip technology inc. preliminary ds70657d-page 117 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 6-1: rcon: re set control register (1) r/w-0 r/w-0 u-0 u-0 r/w-0 u-0 r/w-0 r/w-0 trapr iopuwr ? ?vregsf ?cmvregs bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-1 r/w-1 extr swr swdten (2) wdto sleep idle bor por bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 trapr: trap reset flag bit 1 = a trap conflict reset has occurred 0 = a trap conflict reset has not occurred bit 14 iopuwr: illegal opcode or uninitialized w access reset flag bit 1 = an illegal opcode detection, an illegal address mode or uninitialized w register used as an address pointer caused a reset 0 = an illegal opcode or uninitialized w reset has not occurred bit 13-12 unimplemented: read as ? 0 ? bit 11 vregsf: flash voltage regulator standby during sleep bit 1 = flash voltage regulator is active during sleep 0 = flash voltage regulator goes into standby mode during sleep bit 10 unimplemented: read as ? 0 ? bit 9 cm: configuration mismatch flag bit 1 = a configuration mismatch reset has occurred. 0 = a configuration mismatch reset has not occurred bit 8 vregs: voltage regulator standby during sleep bit 1 = voltage regulator is active during sleep 0 = voltage regulator goes into standby mode during sleep bit 7 extr: external reset (mclr ) pin bit 1 = a master clear (pin) reset has occurred 0 = a master clear (pin) reset has not occurred bit 6 swr: software reset (instruction) flag bit 1 = a reset instruction has been executed 0 = a reset instruction has not been executed bit 5 swdten: software enable/disable of wdt bit (2) 1 = wdt is enabled 0 = wdt is disabled bit 4 wdto: watchdog timer time-out flag bit 1 = wdt time-out has occurred 0 = wdt time-out has not occurred note 1: all of the reset status bits can be set or cleared in software. setting one of these bits in software does not cause a device reset. 2: if the fwdten configuration bit is ? 1 ? (unprogrammed), the wdt is always enabled, regardless of the swdten bit setting.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 118 preliminary ? 2011 microchip technology inc. bit 3 sleep: wake-up from sleep flag bit 1 = device has been in sleep mode 0 = device has not been in sleep mode bit 2 idle: wake-up from idle flag bit 1 = device was in idle mode 0 = device was not in idle mode bit 1 bor: brown-out reset flag bit 1 = a brown-out reset has occurred 0 = a brown-out reset has not occurred bit 0 por: power-on reset flag bit 1 = a power-on reset has occurred 0 = a power-on reset has not occurred register 6-1: rcon: re set control register (1) (continued) note 1: all of the reset status bits can be set or cleared in software. setting one of these bits in software does not cause a device reset. 2: if the fwdten configuration bit is ? 1 ? (unprogrammed), the wdt is always enabled, regardless of the swdten bit setting.
? 2011 microchip technology inc. preliminary ds70657d-page 119 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 7.0 interrupt controller the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/ 50x, and pic24epxxxgp/mc20 x interrupt controller reduces the numerous peripheral interrupt request sig- nals to a single interrupt request signal to the DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x cpu. the interrupt controller has the following features: ? up to eight processor exceptions and software traps ? eight user-selectable priority levels ? interrupt vector table (ivt) with a unique vector for each interrupt or exception source ? fixed priority within a specified user priority level ? fixed interrupt entry and return latencies 7.1 interrupt vector table the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/ 50x, and pic24epxxxgp/mc 20x interrupt vector table (ivt), shown in figure 7-1 , resides in program memory, starting at location 000004h. the ivt contains seven non-maskable trap vectors and up to 114 sources of interrupt. in general, each interrupt source has its own vector. each interrupt vector contains a 24- bit-wide address. the value programmed into each interrupt vector location is the starting address of the associated interrupt service routine (isr). interrupt vectors are prioritized in terms of their natural priority. this priority is linked to their position in the vector table. lower addresses generally have a higher natural priority. for example, the interrupt associated with vector 0 takes priority over interrupts at any other vector address. 7.2 reset sequence a device reset is not a true exception because the interrupt controller is not involved in the reset process. the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/ 50x, and pic24epxxxgp/mc20x devices clear their registers in response to a reset, which forces the pc to zero. the device then begins program execution at location 0x000000. a goto instruction at the reset address can redirect program execution to the appropriate start-up routine. note 1: this data sheet summ arizes the features of the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x families of devices. it is not intended to be a compre- hensive reference source. to comple- ment the information in this data sheet, refer to section 6. ?interrupts? (ds70600) of the ? dspic33e/pic24e family reference manual? , which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for de vice-specific register and bit information. note: any unimplemented or unused vector locations in the ivt should be programmed with the address of a default interrupt handler routine that contains a reset instruction.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 120 preliminary ? 2011 microchip technology inc. figure 7-1: DSPIC33EPXXXGP50X, dspic 33epxxxmc20x/50x, and pic24epxxxgp/mc20x interrupt vector table ivt decreasing natural order priority reset ? goto instruction 0x000000 reset ? goto address 0x000002 oscillator fail trap vector 0x000004 address error trap vector 0x000006 generic hard trap vector 0x000008 stack error trap vector 0x00000a math error trap vector 0x00000c dmac error trap vector 0x00000e generic soft trap vector 0x000010 reserved 0x000012 interrupt vector 0 0x000014 interrupt vector 1 0x000016 :: :: :: interrupt vector 52 0x00007c interrupt vector 53 0x00007e interrupt vector 54 0x000080 :: :: :: interrupt vector 116 0x0000fc interrupt vector 117 0x0000fe interrupt vector 118 0x000100 interrupt vector 119 0x000102 interrupt vector 120 0x000104 :: :: :: interrupt vector 244 0x0001fc interrupt vector 245 0x0001fe start of code 0x000200 see ta b l e 7 - 1 for interrupt vector details
? 2011 microchip technology inc. preliminary ds70657d-page 121 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x table 7-1: interrupt vector details interrupt source vector number irq ivt address interrupt bit location flag enable priority highest natural order priority int0 ? external interrupt 0 8 0 0x000014 ifs0<0> iec0<0> ipc0<2:0> ic1 ? input capture 1 9 1 0x000016 ifs0<1> iec0<1> ipc0<6:4> oc1 ? output compare 1 10 2 0x000018 ifs0<2> iec0<2> ipc0<10:8> t1 ? timer1 11 3 0x00001a ifs0<3> iec0<3> ipc0<14:12> dma0 ? dma channel 0 12 4 0x00001c ifs0<4> iec0<4> ipc1<2:0> ic2 ? input capture 2 13 5 0x00001e ifs0<5> iec0<5> ipc1<6:4> oc2 ? output compare 2 14 6 0x000020 ifs0<6> iec0<6> ipc1<10:8> t2 ? timer2 15 7 0x000022 ifs0<7> iec0<7> ipc1<14:12> t3 ? timer3 16 8 0x000024 ifs0<8> iec0<8> ipc2<2:0> spi1e ? spi1 error 17 9 0x000026 ifs0<9> iec0<9> ipc2<6:4> spi1 ? spi1 transfer done 18 10 0x000028 ifs0<10> iec0<10> ipc2<10:8> u1rx ? uart1 receiver 19 11 0x00002a ifs0<11> iec0<11> ipc2<14:12> u1tx ? uart1 transmitter 20 12 0x00002c ifs0<12> iec0<12> ipc3<2:0> ad1 ? adc1 convert done 21 13 0x00002e ifs0<13> iec0<13> ipc3<6:4> dma1 ? dma channel 1 22 14 0x000030 ifs0<14> iec0<14> ipc3<10:8> reserved 23 15 0x000032 ? ? ? si2c1 ? i2c1 slave event 24 16 0x000034 ifs1<0> iec1<0> ipc4<2:0> mi2c1 ? i2c1 master event 25 17 0x000036 ifs1<1> iec1<1> ipc4<6:4> cm ? comparator combined event 26 18 0x000038 ifs1<2> iec1<2> ipc4<10:8> cn ? input change interrupt 27 19 0x00003a ifs1<3> iec1<3> ipc4<14:12> int1 ? external interrupt 1 28 20 0x00003c ifs1<4> iec1<4> ipc5<2:0> reserved 29-31 21-23 0x00003e- 0x00042 ? ? ? dma2 ? dma channel 2 32 24 0x000044 ifs1<8> iec1<8> ipc6<2:0> oc3 ? output compare 3 33 25 0x000046 ifs1<9> iec1<9> ipc6<6:4> oc4 ? output compare 4 34 26 0x000048 ifs1<10> iec1<10> ipc6<10:8> t4 ? timer4 35 27 0x00004a ifs1<11> iec1<11> ipc6<14:12> t5 ? timer5 36 28 0x00004c ifs1<12> iec1<12> ipc7<2:0> int2 ? external interrupt 2 37 29 0x00004e ifs1<13> iec1<13> ipc7<6:4> u2rx ? uart2 receiver 38 30 0x000050 ifs1<14> iec1<14> ipc7<10:8> u2tx ? uart2 transmitter 39 31 0x000052 ifs1<15> iec1<15> ipc7<14:12> spi2e ? spi2 error 40 32 0x000054 ifs2<0> iec2<0> ipc8<2:0> spi2 ? spi2 transfer done 41 33 0x000056 ifs2<1> iec2<1> ipc8<6:4> c1rx ? can1 rx data ready (1) 42 34 0x000058 ifs2<2> iec2<2> ipc8<10:8> c1 ? can1 event (1) 43 35 0x00005a ifs2<3> iec2<3> ipc8<14:12> dma3 ? dma channel 3 44 36 0x00005c ifs2<4> iec2<4> ipc9<2:0> ic3 ? input capture 3 45 37 0x00005e ifs2<5> iec2<5> ipc9<6:4> ic4 ? input capture 4 46 38 0x000060 ifs2<6> iec2<6> ipc9<10:8> reserved 47-56 39-48 0x000062- 0x000074 ? ? ? si2c2 ? i2c2 slave event 57 49 0x000076 ifs3<1> iec3<1> ipc12<6:4> mi2c2 ? i2c2 master event 58 50 0x000078 ifs3<2> iec3<2> ipc12<10:8> note 1: this interrupt source is available on dspi c33epxxxgp50x and dspic33 epxxxmc50x devices only. 2: this interrupt source is available on dspi c33epxxxmc20x/50x and pic2 4epxxxmc20x devices only.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 122 preliminary ? 2011 microchip technology inc. reserved 59-64 51-56 0x00007a- 0x000084 ? ? ? psem ? pwm special event match (2) 65 57 0x000086 ifs3<9> iec3<9> ipc14<6:4> qei1 ? qei1 position counter compare (2) 66 58 0x000088 ifs3<10> iec3<10> ipc14<10:8> reserved 67-72 59-64 0x00008a- 0x000094 ? ? ? u1e ? uart1 error interrupt 73 65 0x000096 ifs4<1> iec4<1> ipc16<6:4> u2e ? uart2 error interrupt 74 66 0x000098 ifs4<2> iec4<2> ipc16<10:8> crc ? crc generator interrupt 75 67 0x00009a ifs4<3> iec4<3> ipc16<14:12> reserved 76-77 68-69 0x00009c- 0x00009e ? ? ? c1tx ? can1 tx data request (1) 78 70 0x000a0 ifs4<6> iec4<6> ipc17<10:8> reserved 79-84 71-76 0x0000a2 - 0x0000ac ? ? ? ctmu ? ctmu interrupt 85 77 0x0000ae ifs5<13> iec4<13> ipc19<6:4> reserved 86-101 78-93 0x0000b0- 0x0000ce ? ? ? pwm1 ? pwm generator 1 (2) 102 94 0x0000d0 ifs5<14> iec5<14> ipc23<10:8> pwm2 ? pwm generator 2 (2) 103 95 0x0000d2 ifs5<15> iec5<15> ipc23<14:12> pwm3 ? pwm generator 3 (2) 104 96 0x0000d4 ifs6<0> iec6<0> ipc24<2:0> reserved 105-149 97-141 0x0001d6 - 0x00012e ? ? ? icd ? icd application 150 142 0x000142 ifs8<14> iec8<14> ipc35<10:8> jtag ? jtag programming 151 143 0x000130 ifs8<15> iec8<15> ipc35<14:12> reserved 152 144 0x000134 ? ? ? ptgstep ? ptg step 153 145 0x000136 ifs9<1> iec9<1> ipc36<6:4> ptgwdt ? ptg watchdog time-out 154 146 0x000138 ifs9<2> iec9<2> ipc36<10:8> ptg0 ? ptg interrupt 0 155 147 0x00013a ifs9<3> iec9<3> ipc36<14:12> ptg1 ? ptg interrupt 1 156 148 0x00013c ifs9<4> iec9<4> ipc37<2:0> ptg2 ? ptg interrupt 2 157 149 0x00013e ifs9<5> iec9<5> ipc37<6:4> ptg3 ? ptg interrupt 3 158 150 0x000140 ifs9<6> iec9<6> ipc37<10:8> reserved 159-245 151-245 0x000142- 0x0001fe ? ? ? lowest natural order priority table 7-1: interrupt vector details (continued) interrupt source vector number irq ivt address interrupt bit location flag enable priority note 1: this interrupt source is available on dspi c33epxxxgp50x and dspic33 epxxxmc50x devices only. 2: this interrupt source is available on dspi c33epxxxmc20x/50x and pic 24epxxxmc20x devices only.
? 2011 microchip technology inc. preliminary ds70657d-page 123 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 7.3 interrupt resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 7.3.1 key resources ? section 6. ?interrupts? (ds70600) ? code samples ? application notes ? software libraries ? webinars ? all related dspic33e/pic24e family reference manuals sections ? development tools 7.4 interrupt control and status registers DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x de vices implement the following registers for the interrupt controller: ? intcon1 ? intcon2 ? intcon3 ? intcon4 ?inttreg 7.4.1 intcon1 through intcon4 global interrupt control functions are controlled from intcon1, intcon2, intcon3 and intcon4. intcon1 contains the interrupt nesting disable bit (nstdis) as well as the cont rol and status flags for the processor trap sources. the intcon2 register controls external interrupt request signal behavior and the use of the alternate vector table. this register also contains the general interrupt enable bit (gie). intcon3 contains the status flags for the dma, and do stack overflow status trap sources. the intcon4 register contains the software generated hard trap status bit (sght). 7.4.2 ifsx the ifs registers maintain all of the interrupt request flags. each source of interrupt has a status bit, which is set by the respective peripherals or external signal and is cleared via software. 7.4.3 iecx the iec registers maintain all of the interrupt enable bits. these control bits are used to individually enable interrupts from the peripherals or external signals. 7.4.4 ipcx the ipc registers are used to set the interrupt priority level for each source of interrupt. each user interrupt source can be assigned to one of eight priority levels. 7.4.5 inttreg the inttreg register contains the associated interrupt vector number and the new cpu interrupt priority level, which are latched into vector number (vecnum<6:0>) and interrupt level bit (ilr<3:0>) fields in the inttreg register. the new interrupt priority level is the priority of the pending interrupt. the interrupt sources are assigned to the ifsx, iecx and ipcx registers in the same sequence as they are listed in ta b l e 7 - 1 . for example, the int0 (external interrupt 0) is shown as having vector number 8 and a natural order priority of 0. thus, the int0if bit is found in ifs0<0>, the int0ie bit in iec0<0> and the int0ip bits in the first position of ipc0 (ipc0<2:0>). 7.4.6 status/control registers although these registers are not specifically part of the interrupt control hardware, two of the cpu control registers contain bits that control interrupt functionality. for more information on these registers refer to section 2. ?cpu? (ds70359) in the ?dspic33e/ pic24e family reference manual? . ? the cpu status register, sr, contains the ipl<2:0> bits (sr<7:5>). these bits indicate the current cpu interrupt priority level. the user software can change the current cpu priority level by writing to the ipl bits. ? the corcon register contains the ipl3 bit which, together with ipl<2:0>, also indicates the current cpu priority level. ipl3 is a read-only bit so that trap events cannot be masked by the user software. all interrupt registers are described in register 7-3 through register 7-7 in the following pages. note: in the event you are not able to access the product page using t he link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 124 preliminary ? 2011 microchip technology inc. register 7-1: sr: cpu status register (1) r/w-0 r/w-0 r/w-0 r/w-0 r/c-0 r/c-0 r -0 r/w-0 oa ob sa sb oab sab da dc bit 15 bit 8 r/w-0 (3) r/w-0 (3) r/w-0 (3) r-0 r/w-0 r/w-0 r/w-0 r/w-0 ipl<2:0> (2) ra n ov z c bit 7 bit 0 legend: u = unimplemented bit, read as ?0? r = readable bit w = writable bit c = clearable bit -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 7-5 ipl<2:0>: cpu interrupt priority level status bits (2,3) 111 = cpu interrupt priority level is 7 (15). user interrupts disabled 110 = cpu interrupt priority level is 6 (14) 101 = cpu interrupt priority level is 5 (13) 100 = cpu interrupt priority level is 4 (12) 011 = cpu interrupt priority level is 3 (11) 010 = cpu interrupt priority level is 2 (10) 001 = cpu interrupt priority level is 1 (9) 000 = cpu interrupt priority level is 0 (8) note 1: for complete register details, see register 3-1 . 2: the ipl<2:0> bits are concatenated with the ipl<3> bi t (corcon<3>) to form the cpu interrupt priority level. the value in parentheses indicates the ipl, if ipl<3> = 1 . user interrupts are disabled when ipl<3> = 1 . 3: the ipl<2:0> status bits are read-onl y when the nstdis bit (intcon1<15>) = 1 .
? 2011 microchip technology inc. preliminary ds70657d-page 125 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 7-2: corcon: core control register (1) r/w-0 u-0 r/w-0 r/w-0 r/w-0 r-0 r-0 r-0 var ? us<1:0> edt dl<2:0> bit 15 bit 8 r/w-0 r/w-0 r/w-1 r/w-0 r/c-0 r-0 r/w-0 r/w-0 sata satb satdw accsat ipl3 (2) sfa rnd if bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 var: variable exception processing latency control bit 1 = variable exception processing enabled 0 = fixed exception processing enabled bit 3 ipl3: cpu interrupt priority level status bit 3 (2) 1 = cpu interrupt priority level is greater than 7 0 = cpu interrupt priority level is 7 or less note 1: for complete register details, see register 3-2 . 2: the ipl3 bit is concatenated with t he ipl<2:0> bits (sr<7:5>) to form the cpu interrupt priority level.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 126 preliminary ? 2011 microchip technology inc. register 7-3: intcon1: interrupt control register 1 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 nstdis ovaerr (1) ovberr (1) covaerr (1) covberr (1) ovate (1) ovbte (1) covte (1) bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 u-0 sftacerr (1) div0err dmacerr matherr addrerr stkerr oscfail ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 nstdis: interrupt nesting disable bit 1 = interrupt nesting is disabled 0 = interrupt nesting is enabled bit 14 ovaerr: accumulator a overflow trap flag bit (1) 1 = trap was caused by overflow of accumulator a 0 = trap was not caused by overflow of accumulator a bit 13 ovberr: accumulator b overflow trap flag bit (1) 1 = trap was caused by overflow of accumulator b 0 = trap was not caused by overflow of accumulator b bit 12 covaerr: accumulator a catastrophic overflow trap flag bit (1) 1 = trap was caused by catastrophic overflow of accumulator a 0 = trap was not caused by catastrophic overflow of accumulator a bit 11 covberr: accumulator b catastrophic overflow trap flag bit (1) 1 = trap was caused by catastrophic overflow of accumulator b 0 = trap was not caused by catastrophic overflow of accumulator b bit 10 ovate: accumulator a overflow trap enable bit (1) 1 = trap overflow of accumulator a 0 = trap is disabled bit 9 ovbte: accumulator b overflow trap enable bit (1) 1 = trap overflow of accumulator b 0 = trap is disabled bit 8 covte: catastrophic overflow trap enable bit (1) 1 = trap on catastrophic overflow of accumulator a or b enabled 0 = trap is disabled bit 7 sftacerr: shift accumulator error status bit (1) 1 = math error trap was caused by an invalid a ccumulator shift 0 = math error trap was not caused by an invalid accumulator shift bit 6 div0err: divide-by-zero error status bit 1 = math error trap was caused by a divide by zero 0 = math error trap was not caused by a divide by zero bit 5 dmacerr: dmac trap flag bit 1 = dmac trap has occurred 0 = dmac trap has not occurred bit 4 matherr: math error status bit 1 = math error trap has occurred 0 = math error trap has not occurred note 1: this bit is available on dspic33epxxxmc20x /50x and DSPIC33EPXXXGP50X devices only.
? 2011 microchip technology inc. preliminary ds70657d-page 127 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x bit 3 addrerr: address error trap status bit 1 = address error trap has occurred 0 = address error trap has not occurred bit 2 stkerr: stack error trap status bit 1 = stack error trap has occurred 0 = stack error trap has not occurred bit 1 oscfail: oscillator failure trap status bit 1 = oscillator failure trap has occurred 0 = oscillator failure trap has not occurred bit 0 unimplemented: read as ? 0 ? register 7-3: intcon1: interrupt control register 1 (continued) note 1: this bit is available on dspic33epxxxmc20x /50x and DSPIC33EPXXXGP50X devices only.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 128 preliminary ? 2011 microchip technology inc. register 7-4: intcon2: interrupt control register 2 r/w-1 r/w-0 r/w-0 u-0 u-0 u-0 u-0 u-0 gie disi swtrap ? ? ? ? ? bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 ? ? ? ? ? int2ep int1ep int0ep bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 gie: global interrupt enable bit 1 = interrupts and associated ie bits are enabled 0 = interrupts are disabled, but traps are still enabled bit 14 disi: disi instruction status bit 1 = disi instruction is active 0 = disi instruction is not active bit 13 swtrap: software trap status bit 1 = software trap is enabled 0 = software trap is disabled bit 12-3 unimplemented: read as ? 0 ? bit 2 int2ep: external interrupt 2 edge detect polarity select bit 1 = interrupt on negative edge 0 = interrupt on positive edge bit 1 int1ep: external interrupt 1 edge detect polarity select bit 1 = interrupt on negative edge 0 = interrupt on positive edge bit 0 int0ep: external interrupt 0 edge detect polarity select bit 1 = interrupt on negative edge 0 = interrupt on positive edge
? 2011 microchip technology inc. preliminary ds70657d-page 129 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 7-5: intcon3: interrupt control register 3 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 u-0 u-0 u-0 u-0 ? ?daedoovr ? ? ? ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-6 unimplemented: read as ? 0 ? bit 5 dae: dma address error soft trap status bit 1 = dma address error soft trap has occurred 0 = dma address error soft trap has not occurred bit 4 doovr: do stack overflow soft trap status bit 1 = do stack overflow soft trap has occurred 0 = do stack overflow soft trap has not occurred bit 3-0 unimplemented: read as ? 0 ? register 7-6: intcon4: interrupt control register 4 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 u-0 r/w-0 ? ? ? ? ? ? ?sght bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-1 unimplemented: read as ? 0 ? bit 0 sght: software generated hard trap status bit 1 = software generated hard trap has occurred 0 = software generated hard trap has not occurred
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 130 preliminary ? 2011 microchip technology inc. register 7-7: inttreg: interrup t control and status register u-0 u-0 u-0 u-0 r-0 r-0 r-0 r-0 ? ? ? ?ilr<3:0> bit 15 bit 8 u-0 r-0 r-0 r-0 r-0 r-0 r-0 r-0 ? vecnum<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-12 unimplemented: read as ? 0 ? bit 11-8 ilr<3:0>: new cpu interrupt priority level bits 1111 = cpu interrupt priority level is 15 ? ? ? 0001 = cpu interrupt priority level is 1 0000 = cpu interrupt priority level is 0 bit 7 unimplemented: read as ? 0 ? bit 6-0 vecnum<6:0>: vector number of pending interrupt bits 1111111 = interrupt vector pending is number 127 ? ? ? 0000001 = interrupt vector pending is number 9 0000000 = interrupt vector pending is number 8
? 2011 microchip technology inc. preliminary ds70657d-page 131 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 8.0 direct memory access (dma) the dma controller transfers data between peripheral data registers and data space sram in addition, dma can access the entire data memory space. the data memory bus arbiter is utilized when either the cpu or dma attempt to access sram, resulting in potential dma or cpu stalls. the dma controller supports 4 independent channels. each channel can be configured for transfers to or from selected peripherals. some of the peripherals supported by the dma controller include: ? ecan? ? analog-to-digital converter (adc) ? serial peripheral interface (spi) ?uart ? input capture ? output compare refer to ta b l e 8 - 1 for a complete list of supported peripherals. figure 8-1: dma controller note 1: this data sheet summ arizes the features of the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x families of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to section 22. ?direct mem- ory access (dma)? (ds70348) of the ? dspic33e/pic24e family reference manual ?, which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for de vice-specific register and bit information. dma peripheral data memory sram (see figure 4- arbiter
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 132 preliminary ? 2011 microchip technology inc. in addition, dma transfers can be triggered by timers as well as external interrupts. each dma channel is unidirectional. two dma channels must be allocated to read and write to a peripheral. if more than one channel receive a request to transfer data, a simple fixed priority scheme, based on channel number, dictates which channel completes the transfer and which channel, or channels, are left pending. each dma channel moves a block of data, after which it generates an interrupt to the cpu to indicate that the block is available for processing. the dma controller provides these functional capabilities: ? four dma channels ? register indirect with post-increment addressing mode ? register indirect without post-increment addressing mode ? peripheral indirect addressing mode (peripheral generates destination address) ? cpu interrupt after half or full-block transfer com- plete ? byte or word transfers ? fixed priority channel arbitration ? manual (software) or automatic (peripheral dma requests) transfer initiation ? one-shot or auto-repeat block transfer modes ? ping-pong mode (automatic switch between two sram start addresses after each block transfer complete) ? dma request for each channel can be selected from any supported interrupt source ? debug support features the peripherals that can utilize dma are listed in table 8-1 . table 8-1: dma channel to peripheral associations peripheral to dma association dmaxreq register irqsel<7:0> bits dmaxpad register (values to read from peripheral) dmaxpad register (values to write to peripheral) int0 ? external interrupt 0 00000000 ?? ic1 ? input capture 1 00000001 0x0144 (ic1buf) ? ic2 ? input capture 2 00000101 0x014c (ic2buf) ? ic3 ? input capture 3 00100101 0x0154 (ic3buf) ? ic4 ? input capture 4 00100110 0x015c (ic4buf) ? oc1 ? output compare 1 00000010 ? 0x0906 (oc1r) 0x0904 (oc1rs) oc2 ? output compare 2 00000110 ? 0x0910 (oc2r) 0x090e (oc2rs) oc3 ? output compare 3 00011001 ? 0x091a (oc3r) 0x0918 (oc3rs) oc4 ? output compare 4 00011010 ? 0x0924 (oc4r) 0x0922 (oc4rs) tmr2 ? timer2 00000111 ?? tmr3 ? timer3 00001000 ?? tmr4 ? timer4 00011011 ?? tmr5 ? timer5 00011100 ?? spi1 transfer done 00001010 0x0248 (spi1buf) 0x0248 (spi1buf) spi2 transfer done 00100001 0x0268 (spi2buf) 0x0268 (spi2buf) uart1rx ? uart1 receiver 00001011 0x0226 (u1rxreg) ? uart1tx ? uart1 transmitter 00001100 ? 0x0224 (u1txreg) uart2rx ? uart2 receiver 00011110 0x0236 (u2rxreg) ? uart2tx ? uart2 transmitter 00011111 ? 0x0234 (u2txreg) ecan1 ? rx data ready 00100010 0x0440 (c1rxd) ? ecan1 ? tx data request 01000110 ? 0x0442 (c1txd) adc1 ? adc1 convert done 00001101 0x0300 (adc1buf0) ?
? 2011 microchip technology inc. preliminary ds70657d-page 133 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x figure 8-2: dma controller block diagram 8.1 dma resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 8.1.1 key resources ? section 22. ?direct memory access (dma)? (ds70348) ? code samples ? application notes ? software libraries ? webinars ? all related dspic33e/pic24e family reference manuals sections ? development tools 8.2 dmac registers each dmac channel x (where x = 0 through 3) contains the following registers: ? 16-bit dma channel control register (dmaxcon) ? 16-bit dma channel irq select register (dmaxreq) ? 32-bit dma ram primary start address register (dmaxsta) ? 32-bit dma ram secondary start address register (dmaxstb) ? 16-bit dma peripheral address register (dmaxpad) ? 14-bit dma transfer count register (dmaxcnt) additional status registers (dmapwc, dmarqc, dmapps, dmalca, and dsadr) are common to all dmac channels. these status registers provide infor- mation on write and request collisions, as well as on last address and channel access information. the interrupt flags (dmaxif) are located in an ifsx register in the interrupt controller. the corresponding interrupt enable control bits (dmaxie) are located in an iecx register in the interrupt controller, and the corresponding interrupt priority control bits (dmaxip) are located in an ipcx register in the interrupt controller. cpu arbiter peripheral 1 dma peripheral non-dma peripheral 2 dma ready peripheral 3 dma ready ready dma x-bus cpu dma cpu dma cpu dma peripheral indirect address note: cpu and dma address buses are not shown dma control dma controller dma cpu peripheral x-bus irq to dma and interrupt controller modules irq to dma and interrupt controller modules irq to dma and interrupt controller modules 01 2 3 sram for clarity. channels note: in the event you are not able to access the product page using t he link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 134 preliminary ? 2011 microchip technology inc. register 8-1: dma x con: dma channel x control register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 u-0 u-0 u-0 chen size dir half nullw ? ? ? bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 u-0 u-0 r/w-0 r/w-0 ? ?amode<1:0> ? ? mode<1:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 chen: channel enable bit 1 = channel enabled 0 = channel disabled bit 14 size: data transfer size bit 1 = byte 0 =word bit 13 dir: transfer direction bit (source/destination bus select) 1 = read from ram address, write to peripheral address 0 = read from peripheral address, write to ram address bit 12 half: block transfer interrupt select bit 1 = initiate interrupt when half of the data has been moved 0 = initiate interrupt when all of the data has been moved bit 11 nullw: null data peripheral write mode select bit 1 = null data write to peripheral in addition to ram write (dir bit must also be clear) 0 = normal operation bit 10-6 unimplemented: read as ? 0 ? bit 5-4 amode<1:0>: dma channel addressing mode select bits 11 = reserved 10 = peripheral indirect addressing mode 01 = register indirect without post-increment mode 00 = register indirect with post-increment mode bit 3-2 unimplemented: read as ? 0 ? bit 1-0 mode<1:0>: dma channel operating mode select bits 11 = one-shot, ping-pong modes enabled (one block transfer from/to each dma buffer) 10 = continuous, ping-pong modes enabled 01 = one-shot, ping-pong modes disabled 00 = continuous, ping-pong modes disabled
? 2011 microchip technology inc. preliminary ds70657d-page 135 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 8-2: dma x req: dma channel x irq select register r/s-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 force (1) ? ? ? ? ? ? ? bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 irqsel<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 force: force dma transfer bit (1) 1 = force a single dma transfer (manual mode) 0 = automatic dma transfer initiation by dma request bit 14-8 unimplemented: read as ? 0 ? bit 7-0 irqsel<7:0>: dma peripheral irq number select bits 01000110 = ecan1 ? tx data request (2) 00100110 = ic4 ? input capture 4 00100101 = ic3 ? input capture 3 00100010 = ecan1 ? rx data ready (2) 00100001 = spi2 transfer done 00011111 = uart2tx ? uart2 transmitter 00011110 = uart2rx ? uart2 receiver 00011100 = tmr5 ? timer5 00011011 = tmr4 ? timer4 00011010 = oc4 ? output compare 4 00011001 = oc3 ? output compare 3 00001101 = adc1 ? adc1 convert done 00001100 = uart1tx ? uart1 transmitter 00001011 = uart1rx ? uart1 receiver 00001010 = spi1 ? transfer done 00001000 = tmr3 ? timer3 00000111 = tmr2 ? timer2 00000110 = oc2 ? output compare 2 00000101 = ic2 ? input capture 2 00000010 = oc1 ? output compare 1 00000001 = ic1 ? input capture 1 00000000 = int0 ? external interrupt 0 note 1: the force bit cannot be cleared by user software. the force bit is cleared by hardware when the forced dma transfer is complete or the channel is disabled (chen = 0 ). 2: this selection is available in dspic33epxxxgp/mc50x devices only.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 136 preliminary ? 2011 microchip technology inc. register 8-3: dma x stah: dma channel x start address register a (high) u-0 u-0 u-0 u-0 r/w-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 sta<23:16> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-8 unimplemented: read as ? 0 ? bit 7-0 sta<23:16>: primary start address bits (source or destination) register 8-4: dma x stal: dma channel x start address register a (low) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 sta<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 sta<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 sta<15:0>: primary start address bits (source or destination)
? 2011 microchip technology inc. preliminary ds70657d-page 137 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 8-5: dma x stbh: dma channel x start address register b (high) u-0 u-0 u-0 u-0 r/w-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 stb<23:16> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-8 unimplemented: read as ? 0 ? bit 7-0 stb<23:16>: secondary start address bits (source or destination) register 8-6: dma x stbl: dma channel x start address register b (low) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 stb<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 stb<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 stb<15:0>: secondary start address bits (source or destination)
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 138 preliminary ? 2011 microchip technology inc. register 8-7: dma x pad: dma channel x peripheral address register (1) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 pad<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 pad<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 pad<15:0>: peripheral address register bits note 1: if the channel is enabled (i.e., active), writes to th is register may result in unpredictable behavior of the dma channel and should be avoided. register 8-8: dma x cnt: dma channel x transfer count register (1) u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? cnt<13:8> (2) bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 cnt<7:0> (2) bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13-0 cnt<13:0>: dma transfer count register bits (2) note 1: if the channel is enabled (i.e., active), writes to th is register may result in unpredictable behavior of the dma channel and should be avoided. 2: the number of dma transfers = cnt<13:0> + 1.
? 2011 microchip technology inc. preliminary ds70657d-page 139 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 8-9: dsadrh: most recent ram high address register u-0 u-0 u-0 u-0 r/w-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 r-0 r-0 r-0 r-0 r-0 r-0 r-0 r-0 dsadr<23:16> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-8 unimplemented: read as ? 0 ? bit 7-0 dsadr<23:16>: most recent dma address accessed by dma bits register 8-10: dsadrl : most recent ram low address register r-0 r-0 r-0 r-0 r-0 r-0 r-0 r-0 dsadr<15:8> bit 15 bit 8 r-0 r-0 r-0 r-0 r-0 r-0 r-0 r-0 dsadr<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 dsadr<15:0>: most recent dma address accessed by dma bits
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 140 preliminary ? 2011 microchip technology inc. register 8-11: dmapwc: dma peripheral write collision status register u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 u-0 u-0 u-0 r-0 r-0 r-0 r-0 ? ? ? ? pwcol3 pwcol2 pwcol1 pwcol0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-4 unimplemented: read as ? 0 ? bit 3 pwcol3: channel 3 peripheral write collision flag bit 1 = write collision detected 0 = no write collision detected bit 2 pwcol2: channel 2 peripheral write collision flag bit 1 = write collision detected 0 = no write collision detected bit 1 pwcol1: channel 1 peripheral write collision flag bit 1 = write collision detected 0 = no write collision detected bit 0 pwcol0: channel 0 peripheral write collision flag bit 1 = write collision detected 0 = no write collision detected
? 2011 microchip technology inc. preliminary ds70657d-page 141 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 8-12: dmarqc: dma requ est collision status register u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 u-0 u-0 u-0 r-0 r-0 r-0 r-0 ? ? ? ? rqcol3 rqcol2 rqcol1 rqcol0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-4 unimplemented: read as ? 0 ? bit 3 rqcol3: channel 3 transfer request collision flag bit 1 = user force and interrupt-based request collision detected 0 = no request collision detected bit 2 rqcol2: channel 2 transfer request collision flag bit 1 = user force and interrupt-bas ed request collision detected 0 = no request collision detected bit 1 rqcol1: channel 1 transfer request collision flag bit 1 = user force and interrupt-bas ed request collision detected 0 = no request collision detected bit 0 rqcol0: channel 0 transfer request collision flag bit 1 = user force and interrupt-based request collision detected 0 = no request collision detected
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 142 preliminary ? 2011 microchip technology inc. register 8-13: dmalca: dma last channel active dma status register u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 u-0 u-0 u-0 r-1 r-1 r-1 r-1 ? ? ? ? lstch<3:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-4 unimplemented: read as ? 0 ? bit 3-0 lstch<3:0>: last dmac channel active status bits 1111 = no dma transfer has occurred since system reset 1110 = reserved ? ? ? 0100 = reserved 0011 = last data transfer was handled by channel 3 0010 = last data transfer was handled by channel 2 0001 = last data transfer was handled by channel 1 0000 = last data transfer was handled by channel 0
? 2011 microchip technology inc. preliminary ds70657d-page 143 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 8-14: dmapps: dma ping-pong status register u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 u-0 u-0 u-0 r-0 r-0 r-0 r-0 ? ? ? ? ppst3 ppst2 ppst1 ppst0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-4 unimplemented: read as ? 0 ? bit 3 ppst3: channel 3 ping-pong mode status flag bit 1 = dmastb3 register selected 0 = dmasta3 register selected bit 2 ppst2: channel 2 ping-pong mode status flag bit 1 = dmastb2 register selected 0 = dmasta2 register selected bit 1 ppst1: channel 1 ping-pong mode status flag bit 1 = dmastb1 register selected 0 = dmasta1 register selected bit 0 ppst0: channel 0 ping-pong mode status flag bit 1 = dmastb0 register selected 0 = dmasta0 register selected
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 144 preliminary ? 2011 microchip technology inc. notes:
? 2011 microchip technology inc. preliminary ds70657d-page 145 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 9.0 oscillator configuration the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/ 50x, and pic24epxxxgp/mc 20x oscillator system provides: ? on-chip phase-locked loop (pll) to boost inter- nal operating frequency on select internal and external oscillator sources ? on-the-fly clock switching between various clock sources ? doze mode for system power savings ? fail-safe clock monitor (fscm) that detects clock failure and permits safe application recovery or shutdown ? configuration bits for clock source selection a simplified diagram of the oscillator system is shown in figure 9-1 . figure 9-1: oscillator system diagram note 1: this data sheet summ arizes the features of the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x families of devices. it is not intended to be a compre- hensive reference source. to comple- ment the information in this data sheet, refer to section 7. ?oscillator? (ds70580) of the ? dspic33e/pic24e family reference manual ?, which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for de vice-specific register and bit information. note 1: see figure 9-2 for pll and f vco details. 2: if the oscillator is used with xt or hs modes, an external parallel resistor with the value of 1 m must be connected. 3: the term f p refers to the clock source for all peripherals, while f cy refers to the clock source for the cpu. throughout this docu- ment, f cy and f p are used interchangeably, except in the case of doze mode. f p and f cy will be different when doze mode is used with a doze ratio of 1:2 or lower. xtpll, hspll, xt, hs, ec frcdiv<2:0> wdt, pwrt, frcdivn frcdiv16 ecpll, frcpll nosc<2:0> fnosc<2:0> reset frc oscillator lprc oscillator doze<2:0> s3 s1 s2 s1/s3 s7 s6 frc lprc s0 s5 16 clock switch s7 clock fail 2 tun<5:0> pll (1) f cy (3) f osc frcdiv doze fscm poscclk frcclk f vco (1) osc2 osc1 primary oscillator r (2) poscmd<1:0> f p (3) n rosel rodiv<3:0> refclko poscclk rpn f osc reference clock generation
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 146 preliminary ? 2011 microchip technology inc. 9.1 cpu clocking system the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/ 50x, and pic24epxxxgp/mc20x family of devices provide seven system clock options: ? fast rc (frc) oscillator ? frc oscillator with phase-locked loop (pll) ? frc oscillator with postscaler ? primary (xt, hs or ec) oscillator ? primary oscillator with pll ? low-power rc (lprc) oscillator instruction execution speed or device operating frequency, f cy , is given by equation 9-1 . equation 9-1: device operating frequency figure 9-2 is a block diagram of the pll module. equation 9-2 provides the relation between input frequency (f in ) and output frequency (f osc ). equation 9-3 provides the relation between input frequency (f in ) and vco frequency (f sys ). figure 9-2: pll block diagram equation 9-2: f osc calculation equation 9-3: f vco calculation f cy = fosc /2 n1 m n2 pfd vco pllpre<4:0> plldiv<8:0> pllpost<1:0> 0.8 mhz < f plli (1) < 8.0 mhz 120 mh z < f sys (1) < 340 mh z f osc 120 mhz @ +125oc f in f plli f sys f osc note 1: this frequency range must be met at all times. f osc 140 mhz @ +85oc f osc f in m n 1 n 2 --------------------- - ?? ?? f in plldiv 2 + () pllpre 2 + () 2 pllpost 1 + () ---------------------------------------------------------------------------------------- - ?? ?? == where, n 1 = pllpre + 2 n 2 = 2 x ( pllpost + 1) m = plldiv + 2 f sys f in m n 1 ------ - ?? ?? f in plldiv 2 + () pllpre 2 + () ------------------------------------ - ?? ?? ==
? 2011 microchip technology inc. preliminary ds70657d-page 147 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x table 9-1: configuration bi t values for clock selection 9.2 oscillator resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 9.2.1 key resources ? section 7. ?oscillator? (ds70580) ? code samples ? application notes ? software libraries ? webinars ? all related dspic33e/pic24e family reference manuals sections ? development tools oscillator mode oscillator source poscmd<1:0> fnosc<2:0> see note fast rc oscillator with divide-by-n (frcdivn) internal xx 111 1, 2 low-power rc oscillator (lprc) internal xx 101 1 primary oscillator (hs) with pll (hspll) primary 10 011 ? primary oscillator (xt) with pll (xtpll) primary 01 011 ? primary oscillator (ec) with pll (ecpll) primary 00 011 1 primary oscillator (hs) primary 10 010 ? primary oscillator (xt) primary 01 010 ? primary oscillator (ec) primary 00 010 1 fast rc oscillator (frc) with divide-by-n and pll (frcpll) internal xx 001 1 fast rc oscillator (frc) internal xx 000 1 note 1: osc2 pin function is determined by the osciofnc configuration bit. 2: this is the default oscillator mode for an unprogrammed (erased) device. note: in the event you are not able to access the product page using t he link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 148 preliminary ? 2011 microchip technology inc. register 9-1: osccon: os cillator control register (1,3) u-0 r-0 r-0 r-0 u-0 r/w-y r/w-y r/w-y ? cosc<2:0> ? nosc<2:0> (2) bit 15 bit 8 r/w-0 r/w-0 r-0 u-0 r/c-0 u-0 u-0 r/w-0 clklock iolock lock ?cf ? ?oswen bit 7 bit 0 legend: y = value set from configuration bits on por r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-12 cosc<2:0>: current oscillator selection bits (read-only) 111 = fast rc oscillator (frc) with divide-by-n 110 = fast rc oscillator (frc) with divide-by-16 101 = low-power rc oscillator (lprc) 100 = reserved 011 = primary oscillator (xt, hs, ec) with pll 010 = primary oscillator (xt, hs, ec) 001 = fast rc oscillator (frc) with divide-by-n and pll (frcpll) 000 = fast rc oscillator (frc) bit 11 unimplemented: read as ? 0 ? bit 10-8 nosc<2:0>: new oscillator selection bits (2) 111 = fast rc oscillator (frc) with divide-by-n 110 = fast rc oscillator (frc) with divide-by-16 101 = low-power rc oscillator (lprc) 100 = reserved 011 = primary oscillator (xt, hs, ec) with pll 010 = primary oscillator (xt, hs, ec) 001 = fast rc oscillator (frc) with divide-by-n and pll (frcpll) 000 = fast rc oscillator (frc) bit 7 clklock: clock lock enable bit 1 = if (fcksm0 = 1 ), then clock and pll configurations are locked if (fcksm0 = 0 ), then clock and pll configurations may be modified 0 = clock and pll selections are not lo cked, configurations may be modified bit 6 iolock: i/o lock enable bit 1 = i/o lock is active 0 = i/o lock is not active bit 5 lock: pll lock status bit (read-only) 1 = indicates that pll is in lock, or pll start-up timer is satisfied 0 = indicates that pll is out of lock, start-up timer is in progress or pll is disabled bit 4 unimplemented: read as ? 0 ? note 1: writes to this register require an unlock sequence. refer to section 7. ?oscillator? (ds70580) in the ?dspic33e/pic24e family reference manual? (available from the microchip web site) for details. 2: direct clock switches between any primary oscillator mode with pll and frcpll mode are not permitted. this applies to clock switches in either direction. in these instances, the applic ation must switch to frc mode as a transition clock source between the two pll modes. 3: this register resets only on a power-on reset (por).
? 2011 microchip technology inc. preliminary ds70657d-page 149 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x bit 3 cf: clock fail detect bit (read/clear by application) 1 = fscm has detect ed clock failure 0 = fscm has not dete cted clock failure bit 2-1 unimplemented: read as ? 0 ? bit 0 oswen: oscillator switch enable bit 1 = request oscillator switch to selection specified by nosc<2:0> bits 0 = oscillator switch is complete register 9-1: osccon: os cillator control register (1,3) (continued) note 1: writes to this register require an unlock sequence. refer to section 7. ?oscillator? (ds70580) in the ?dspic33e/pic24e family reference manual? (available from the microchip web site) for details. 2: direct clock switches between any primary oscillator mode with pll and frcpll mode are not permitted. this applies to clock switches in either direction. in these instances, the application must switch to frc mode as a transition clock source between the two pll modes. 3: this register resets only on a power-on reset (por).
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 150 preliminary ? 2011 microchip technology inc. register 9-2: clkdiv: clock divisor register (2) r/w-0 r/w-0 r/w-1 r/w-1 r/w-0 r/w-0 r/w-0 r/w-0 roi doze<2:0> (3) dozen (1,4) frcdiv<2:0> bit 15 bit 8 r/w-0 r/w-1 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 pllpost<1:0> ? pllpre<4:0> bit 7 bit 0 legend: y = value set from configuration bits on por r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 roi: recover on interrupt bit 1 = interrupts will clear the dozen bit and the processor clock and peripheral clock ratio is set to 1:1 0 = interrupts have no effect on the dozen bit bit 14-12 doze<2:0>: processor clock reduction select bits (3) 111 = f cy divided by 128 110 = f cy divided by 64 101 = f cy divided by 32 100 = f cy divided by 16 011 = f cy divided by 8 (default) 010 = f cy divided by 4 001 = f cy divided by 2 000 = f cy divided by 1 bit 11 dozen: doze mode enable bit (1,4) 1 = doze<2:0> field specifies the ratio between the peripheral clocks and the processor clocks 0 = processor clock and peripheral clock ratio forced to 1:1 bit 10-8 frcdiv<2:0>: internal fast rc osci llator postscaler bits 111 = frc divided by 256 110 = frc divided by 64 101 = frc divided by 32 100 = frc divided by 16 011 = frc divided by 8 010 = frc divided by 4 001 = frc divided by 2 000 = frc divided by 1 (default) bit 7-6 pllpost<1:0>: pll vco output divider select bits (also denoted as ?n2?, pll postscaler) 11 = output divided by 8 10 = reserved 01 = output divided by 4 (default) 00 = output divided by 2 bit 5 unimplemented: read as ? 0 ? note 1: this bit is cleared when the roi bi t is set and an interrupt occurs. 2: this register resets only on a power-on reset (por). 3: doze<2:0> bits can only be written to when the dozen bit is clear. if dozen = 1 , any writes to doze<2:0> are ignored. 4: the dozen bit cannot be set if doze<2:0> = 000 . if doze<2:0> = 000 , any attempt by user software to set the dozen bit is ignored.
? 2011 microchip technology inc. preliminary ds70657d-page 151 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x bit 4-0 pllpre<4:0>: pll phase detector input divider select bits (also denoted as ?n1?, pll prescaler) 11111 = input divided by 33 ? ? ? 00001 = input divided by 3 00000 = input divided by 2 (default) register 9-2: clkdiv: clock divisor register (2) (continued) note 1: this bit is cleared when the roi bit is set and an interrupt occurs. 2: this register resets only on a power-on reset (por). 3: doze<2:0> bits can only be written to w hen the dozen bit is clear. if dozen = 1 , any writes to doze<2:0> are ignored. 4: the dozen bit cannot be set if doze<2:0> = 000 . if doze<2:0> = 000 , any attempt by user software to set the dozen bit is ignored.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 152 preliminary ? 2011 microchip technology inc. register 9-3: pllfbd: pll feedback divisor register (1) u-0 u-0 u-0 u-0 u-0 u-0 u-0 r/w-0 ? ? ? ? ? ? ?plldiv<8> bit 15 bit 8 r/w-0 r/w-0 r/w-1 r/w-1 r/w-0 r/w-0 r/w-0 r/w-0 plldiv<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-9 unimplemented: read as ? 0 ? bit 8-0 plldiv<8:0>: pll feedback divisor bits (also denoted as ?m?, pll multiplier) 111111111 = 513 ? ? ? 000110000 = 50 (default) ? ? ? 000000010 = 4 000000001 = 3 000000000 = 2 note 1: this register is reset only on a power-on reset (por).
? 2011 microchip technology inc. preliminary ds70657d-page 153 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 9-4: osctun: frc os cillator tuning register (1) u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? tun<5:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-6 unimplemented: read as ? 0 ? bit 5-0 tun<5:0>: frc oscillator tuning bits 111111 = center frequency -0.375% (7.345 mhz) ? ? ? 100001 = center frequency -11.625% (6.52 mhz) 100000 = center frequency -12% (6.49 mhz) 011111 = center frequency + 11.625% (8.23 mhz) 011110 = center frequency + 11.25% (8.20 mhz) ? ? ? 000001 = center frequency + 0.375% (7.40 mhz) 000000 = center frequency (7.37 mhz nominal) note 1: this register resets only on a power-on reset (por).
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 154 preliminary ? 2011 microchip technology inc. register 9-5: refocon: reference oscillator control register r/w-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 roon ? rosslp rosel rodiv<3:0> (1) bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 roon: reference oscillator output enable bit 1 = reference oscillator output enabled on refclk (2) pin 0 = reference oscillator output disabled bit 14 unimplemented: read as ? 0 ? bit 13 rosslp: reference oscillator run in sleep bit 1 = reference oscillator output continues to run in sleep 0 = reference oscillator output is disabled in sleep bit 12 rosel: reference oscillator source select bit 1 = oscillator crystal used as the reference clock 0 = system clock used as the reference clock bit 11-8 rodiv<3:0>: reference oscillator divider bits (1) 1111 = reference clock divided by 32,768 1110 = reference clock divided by 16,384 1101 = reference clock divided by 8,192 1100 = reference clock divided by 4,096 1011 = reference clock divided by 2,048 1010 = reference clock divided by 1,024 1001 = reference clock divided by 512 1000 = reference clock divided by 256 0111 = reference clock divided by 128 0110 = reference clock divided by 64 0101 = reference clock divided by 32 0100 = reference clock divided by 16 0011 = reference clock divided by 8 0010 = reference clock divided by 4 0001 = reference clock divided by 2 0000 = reference clock bit 7-0 unimplemented: read as ? 0 ? note 1: the reference oscillator output must be disabled (roon = 0 ) before writing to these bits. 2: this pin is remappable. see section 11.4 ?peripheral pin select? for more information.
? 2011 microchip technology inc. preliminary ds70657d-page 155 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 10.0 power-saving features the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/ 50x, and pic24epxxxgp/mc 20x devices provide the ability to manage power consumption by selectively managing clocking to the cpu and the peripherals. in general, a lower clock frequency and a reduction in the number of peripherals being clocked constitutes lower consumed power. DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x devices can manage power consumption in four ways: ? clock frequency ? instruction-based sleep and idle modes ? software-controlled doze mode ? selective peripheral control in software combinations of these methods can be used to selec- tively tailor an application?s power consumption while still maintaining critical application features, such as timing-sensitive communications. 10.1 clock frequency and clock switching the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/ 50x, and pic24epxxxgp/ mc20x devices allow a wide range of clock frequencies to be selected under application control. if the system clock configuration is not locked, users can choose low-power or high- precision oscillators by simply changing the nosc bits (osccon<10:8>). the process of changing a system clock during operation, as well as limitations to the process, are discussed in more detail in section 9.0 ?oscillator configuration? . 10.2 instruction-based power-saving modes the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/ 50x, and pic24epxxxgp/mc20x devices have two special power-saving mo des that are entered through the execution of a special pwrsav instruction. sleep mode stops clock operation and halts all code execution. idle mode halts the cpu and code execution, but allows peripheral modules to continue operation. the assembler syntax of the pwrsav instruction is shown in example 10-1 . sleep and idle modes can be exited as a result of an enabled interrupt, wdt time-out or a device reset. when the device exits these modes, it is said to ?wake up?. example 10-1: pwrsav instruction syntax note 1: this data sheet summ arizes the features of the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x families of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to section 9. ?watchdog timer and power-saving modes? (ds70615) of the ? dspic33e/pic24e family reference manual ?, which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for de vice-specific register and bit information. note: sleep_mode and idle_mode are con- stants defined in the assembler include file for the selected device. pwrsav #sleep_mode ; put the device into sleep mode pwrsav #idle_mode ; put the device into idle mode
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 156 preliminary ? 2011 microchip technology inc. 10.2.1 sleep mode the following occur in sleep mode: ? the system clock source is shut down. if an on-chip oscillator is used, it is turned off. ? the device current consumption is reduced to a minimum, provided that no i/o pin is sourcing current ? the fail-safe clock monitor does not operate, since the system clock source is disabled ? the lprc clock continues to run in sleep mode if the wdt is enabled ? the wdt, if enabled, is automatically cleared prior to entering sleep mode ? some device features or peripherals can continue to operate. this includes items such as the input change notification on the i/o ports, or peripherals that use an external clock input. ? any peripheral that requires the system clock source for its operation is disabled the device wakes up from sleep mode on any of the these events: ? any interrupt source that is individually enabled ? any form of device reset ? a wdt time-out on wake-up from sleep mode, the processor restarts with the same clock source that was active when sleep mode was entered. for optimal power savings, the internal regulator and the flash regulator can be configured to go into stand- by when sleep mode is entered by clearing the vregs (rcon<8>) and vregsf (rcon<11>) bits (default configuration). if the application requires a faster wake-up time, and can accept higher current requirements, the vregs (rcon<8>) and vregsf (rco n<11>) bits can be set to keep the internal regulator and the flash regulator active during sleep mode. 10.2.2 idle mode the following occur in idle mode: ? the cpu stops executing instructions ? the wdt is automatically cleared ? the system clock source remains active. by default, all peripheral modules continue to operate normally from the system clock source, but can also be selectively disabled (see section 10.4 ?peripheral module disable? ). ? if the wdt or fscm is enabled, the lprc also remains active. the device wakes from idle mode on any of these events: ? any interrupt that is individually enabled ? any device reset ? a wdt time-out on wake-up from idle mode, the clock is reapplied to the cpu and instruction execution will begin (2-4 clock cycles later), starting with th e instruction following the pwrsav instruction, or the firs t instruction in the isr. all peripherals also have the option to discontinue operation when idle mode is entered to allow for increased power savings. th is option is selectable in the control register of each peripheral. for example, the tsidl bit in the timer1 control register (t1con<13>). 10.2.3 interrupts coincident with power save instructions any interrupt that coincide s with the execution of a pwrsav instruction is held off until entry into sleep or idle mode has completed. the device then wakes up from sleep or idle mode.
? 2011 microchip technology inc. preliminary ds70657d-page 157 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 10.3 doze mode the preferred strategies for reducing power consumption are changing clock speed and invoking one of the power-saving modes. in some circumstances, this cannot be practical. for example, it may be necessary for an application to maintain uninterrupted synchronous co mmunication, even while it is doing nothing else. reducing system clock speed can introduce communication errors, while using a power-saving mode can stop communications completely. doze mode is a simple and effective alternative method to reduce power consumption while the device is still executing code. in this mode, the system clock continues to operate from t he same source and at the same speed. peripheral modules continue to be clocked at the same speed, while the cpu clock speed is reduced. synchronization between the two clock domains is maintained, allowing the peripherals to access the sfrs while the cpu executes code at a slower rate. doze mode is enabled by setting the dozen bit (clkdiv<11>). the ratio between peripheral and core clock speed is determined by the doze<2:0> bits (clkdiv<14:12>). there are eight possible configurations, from 1:1 to 1:128, with 1:1 being the default setting. programs can use doze mode to selectively reduce power consumption in event-driven applications. this allows clock-sensitive functions, such as synchronous communications, to continue without interruption while the cpu idles, waiting for something to invoke an interrupt routine. an automatic return to full-speed cpu operation on interrupts can be enabled by setting the roi bit (clkdiv<15>). by default, interrupt events have no effect on doze mode operation. for example, suppose the device is operating at 20 mips and the ecan module has been configured for 500 kbps based on this device operating speed. if the device is placed in doze mode with a clock frequency ratio of 1:4, the ecan module continues to communicate at the required bit rate of 500 kbps, but the cpu now starts execut ing instructions at a frequency of 5 mips. 10.4 peripheral module disable the peripheral module disable (pmd) registers provide a method to disable a peripheral module by stopping all clock sources supplied to that module. when a peripheral is disabl ed using the appropriate pmd control bit, the peripheral is in a minimum power consumption state. the control and status registers associated with the peripheral are also disabled, so writes to those registers do not have effect and read values are invalid. a peripheral module is enabled only if both the associated bit in the pmd register is cleared and the peripheral is supported by the specific dspic ? dsc variant. if the peripheral is present in the device, it is enabled in the pmd register by default. 10.5 power-saving resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 10.5.1 key resources ? section 9. ?watchdog timer and power-saving modes? (ds70615) ? code samples ? application notes ? software libraries ? webinars ? all related dspic33e/pic24e family reference manuals sections ? development tools note: if a pmd bit is set, the corresponding module is disabled after a delay of one instruction cycle. simila rly, if a pmd bit is cleared, the corresponding module is enabled after a delay of one instruction cycle (assuming the m odule control regis- ters are already configured to enable module operation). note: in the event you are not able to access the product page using the link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 158 preliminary ? 2011 microchip technology inc. register 10-1: pmd1: peripheral module disable control register 1 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 u-0 t5md t4md t3md t2md t1md qei1md (1) pwmmd (1) ? bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 u-0 r/w-0 r/w-0 i2c1md u2md u1md spi2md spi1md ?c1md (2) ad1md bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 t5md: timer5 module disable bit 1 = timer5 module is disabled 0 = timer5 module is enabled bit 14 t4md: timer4 module disable bit 1 = timer4 module is disabled 0 = timer4 module is enabled bit 13 t3md: timer3 module disable bit 1 = timer3 module is disabled 0 = timer3 module is enabled bit 12 t2md: timer2 module disable bit 1 = timer2 module is disabled 0 = timer2 module is enabled bit 11 t1md: timer1 module disable bit 1 = timer1 module is disabled 0 = timer1 module is enabled bit 10 qei1md: qei1 module disable bit (1) 1 = qei1 module is disabled 0 = qei1 module is enabled bit 9 pwmmd: pwm module disable bit (1) 1 = pwm module is disabled 0 = pwm module is enabled bit 8 unimplemented: read as ? 0 ? bit 7 i2c1md: i2c1 module disable bit 1 = i2c1 module is disabled 0 = i2c1 module is enabled bit 6 u2md: uart2 module disable bit 1 = uart2 module is disabled 0 = uart2 module is enabled bit 5 u1md: uart1 module disable bit 1 = uart1 module is disabled 0 = uart1 module is enabled bit 4 spi2md: spi2 module disable bit 1 = spi2 module is disabled 0 = spi2 module is enabled note 1: this bit is available on dspic33epxxxmc20x /50x and pic24epxxxmc20x devices only. 2: this bit is available on dspic33epxxxgp 50x and dspic33epxxxmc50x devices only.
? 2011 microchip technology inc. preliminary ds70657d-page 159 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x bit 3 spi1md: spi1 module disable bit 1 = spi1 module is disabled 0 = spi1 module is enabled bit 2 unimplemented: read as ? 0 ? bit 1 c1md: ecan1 module disable bit (2) 1 = ecan1 module is disabled 0 = ecan1 module is enabled bit 0 ad1md: adc1 module disable bit 1 = adc1 module is disabled 0 = adc1 module is enabled register 10-1: pmd1: peripheral module disable control register 1 (continued) note 1: this bit is available on dspic33epxxxmc20x /50x and pic24epxxxmc 20x devices only. 2: this bit is available on dspic33epxxxgp 50x and dspic33epxxxmc50x devices only.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 160 preliminary ? 2011 microchip technology inc. register 10-2: pmd2: peripheral module disable control register 2 u-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? ? ? ic4md ic3md ic2md ic1md bit 15 bit 8 u-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? ? ? oc4md oc3md oc2md oc1md bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-12 unimplemented: read as ? 0 ? bit 11 ic4md: input capture 4 module disable bit 1 = input capture 4 module is disabled 0 = input capture 4 module is enabled bit 10 ic3md: input capture 3 module disable bit 1 = input capture 3 module is disabled 0 = input capture 3 module is enabled bit 9 ic2md: input capture 2 module disable bit 1 = input capture 2 module is disabled 0 = input capture 2 module is enabled bit 8 ic1md: input capture 1 module disable bit 1 = input capture 1 module is disabled 0 = input capture 1 module is enabled bit 7-4 unimplemented: read as ? 0 ? bit 3 oc4md: output compare 4 module disable bit 1 = output compare 4 module is disabled 0 = output compare 4 module is enabled bit 2 oc3md: output compare 3 module disable bit 1 = output compare 3 module is disabled 0 = output compare 3 module is enabled bit 1 oc2md: output compare 2 module disable bit 1 = output compare 2 module is disabled 0 = output compare 2 module is enabled bit 0 oc1md: output compare 1 module disable bit 1 = output compare 1 module is disabled 0 = output compare 1 module is enabled
? 2011 microchip technology inc. preliminary ds70657d-page 161 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 10-3: pmd3: peripheral module disable control register 3 register 10-4: pmd4: peripheral module disable control register 4 u-0 u-0 u-0 u-0 u-0 r/w-0 u-0 u-0 ? ? ? ? ? cmpmd ? ? bit 15 bit 8 r/w-0 u-0 u-0 u-0 u-0 u-0 r/w-0 u-0 crcmd ? ? ? ? ? i2c2md ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-11 unimplemented: read as ? 0 ? bit 10 cmpmd: comparator module disable bit 1 = comparator module is disabled 0 = comparator module is enabled bit 9-8 unimplemented: read as ? 0 ? bit 7 crcmd: crc module disable bit 1 = crc module is disabled 0 = crc module is enabled bit 6-2 unimplemented: read as ? 0 ? bit 1 i2c2md: i2c2 module disable bit 1 = i2c2 module is disabled 0 = i2c2 module is enabled bit 0 unimplemented: read as ? 0 ? u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 u-0 u-0 u-0 r/w-0 r/w-0 u-0 u-0 ? ? ? ?refomdctmumd ? ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-4 unimplemented: read as ? 0 ? bit 3 refomd: reference clock module disable bit 1 = reference clock module is disabled 0 = reference clock module is enabled bit 2 ctmumd: ctmu module disable bit 1 = ctmu module is disabled 0 = ctmu module is enabled bit 1-0 unimplemented: read as ? 0 ?
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 162 preliminary ? 2011 microchip technology inc. register 10-5: pmd6: peripheral module disable control register 6 u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 ? ? ? ? ?pwm3md (1) pwm2md (1) pwm1md (1) bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-11 unimplemented: read as ? 0 ? bit 10 pwm3md: pwm3 module disable bit (1) 1 = pwm3 module is disabled 0 = pwm3 module is enabled bit 9 pwm2md: pwm2 module disable bit (1) 1 = pwm2 module is disabled 0 = pwm2 module is enabled bit 8 pwm1md: pwm1 module disable bit (1) 1 = pwm1 module is disabled 0 = pwm1 module is enabled bit 7-0 unimplemented: read as ? 0 ? note 1: this bit is available in dspic33epxxxmc5 0x/20x and pic24epxxxmc20x devices only.
? 2011 microchip technology inc. preliminary ds70657d-page 163 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 10-6: pmd7: peripheral module disable control register 7 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 u-0 u-0 r/w-0 r/w-0 u-0 u-0 u-0 ? ? ? dma0md (1) ptgmd ? ? ? dma1md (1) dma2md (1) dma3md (1) bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-5 unimplemented: read as ? 0 ? bit 4 dma0md: dma0 module disable bit (1) 1 = dma0 module is disabled 0 = dma0 module is enabled dma1md: dma1 module disable bit (1) 1 = dma1 module is disabled 0 = dma1 module is enabled dma2md: dma2 module disable bit (1) 1 = dma2 module is disabled 0 = dma2 module is enabled dma3md: dma3 module disable bit (1) 1 = dma3 module is disabled 0 = dma3 module is enabled bit 3 ptgmd: ptg module disable bit 1 = ptg module is disabled 0 = ptg module is enabled bit 2-0 unimplemented: read as ? 0 ? note 1: this single bit enables and disables all four dma channels.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 164 preliminary ? 2011 microchip technology inc. notes:
? 2011 microchip technology inc. preliminary ds70657d-page 165 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 11.0 i/o ports many of the device pins are shared among the peripherals and the parallel i/o ports. all i/o input ports feature schmitt trigger inputs for improved noise immunity. 11.1 parallel i/o (pio) ports generally, a parallel i/o port that shares a pin with a peripheral is subservient to the peripheral. the peripheral?s output buffer data and control signals are provided to a pair of multiplexers. the multiplexers select whether the peripher al or the associated port has ownership of the output data and control signals of the i/o pin. the logic also prevents ?loop through,? in which a port?s digital output can drive the input of a peripheral that shares the same pin. figure 11-1 illustrates how ports are shared with other peripherals and the associated i/o pin to which they are connected. when a peripheral is enabled and the peripheral is actively driving an associated pin, the use of the pin as a general purpose output pin is disabled. the i/o pin can be read, but the output driver for the parallel port bit is disabled. if a peripheral is enabled, but the peripheral is not actively driving a pin, that pin can be driven by a port. all port pins have eight registers directly associated with their operation as digital i/o. the data direction register (trisx) determines whether the pin is an input or an output. if the data direction bit is a ? 1 ?, then the pin is an input. all port pins are defined as inputs after a reset. reads from the latch (latx) read the latch. writes to the latch write t he latch. reads from the port (portx) read the port pins, while writes to the port pins write the latch. any bit and its associated data and control registers that are not valid for a particular device is disabled. this means the corresponding latx and trisx registers and the port pin are read as zeros. when a pin is shared wit h another peripheral or function that is defined as an input only, it is nevertheless regarded as a dedicated port because there is no other compet ing source of outputs. figure 11-1: block diagram of a typical shared port structure note 1: this data sheet summ arizes the features of the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x families of devices. it is not intended to be a compre- hensive reference source. to comple- ment the information in this data sheet, refer to section 10. ?i/o ports? (ds70598) of the ? dspic33e/pic24e family reference manual ?, which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for de vice-specific register and bit information. q d ck wr lat + tris latch i/o pin wr port data bus q d ck data latch read port read tris 1 0 1 0 wr tris peripheral output data output enable peripheral input data i/o peripheral module peripheral output enable pio module output multiplexers output data input data peripheral module enable read lat
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 166 preliminary ? 2011 microchip technology inc. 11.1.1 open-drain configuration in addition to the port, lat and tris registers for data control, port pins can also be individually configured for either digital or open-drain output. this is controlled by the open -drain contro l register, odcx, associated with each port. setting any of the bits configures the corresponding pin to act as an open-drain output. the open-drain feature a llows the generation of outputs other than v dd by using external pull-up resistors. the maximum open-drain voltage allowed on any pin is the same as the maximum v ih specification for that particular pin. see the ?pin diagrams? section for the available 5v-tolerant pins and table 30-10 for the maximum v ih specification for each pin. 11.2 configuring analog and digital port pins the anselx register controls the operation of the analog port pins. the port pins that are to function as analog inputs or outputs must have their corresponding ansel and tris bits set. in order to use port pins for i/o functionality with digital modules, such as timers, uarts, etc., the corresponding anselx bit must be cleared. the anselx register has a default value of 0xffff; therefore, all pins that share analog functions are analog (not digital) by default. pins with analog functions affected by the anselx registers are listed with a buff er type of analog in the pinout i/o descriptions (see ta b l e 1 - 1 ). if the tris bit is cleared (output) while the anselx bit is set, the digital output level (v oh or v ol ) is converted by an analog peripheral, such as the adc module or comparator module. when the port register is read, all pins configured as analog input channels are read as cleared (a low level). pins configured as digital inputs do not convert an analog input. analog levels on any pin defined as a digital input (including the anx pins) can cause the input buffer to consume current that exceeds the device specifications. 11.2.1 i/o port write/read timing one instruction cycle is required between a port direction change or port write operation and a read operation of the same port. typically this instruction would be an nop , as shown in example 11-1 . 11.3 input change notification the input change notification function of the i/o ports allows devices to generate interrupt requests to the processor in response to a change-of-state on selected input pins. this feature can detect input change-of- states even in sleep mode, when the clocks are disabled. every i/o port pin can be selected (enabled) for generating an interrupt request on a change-of- state. three control registers ar e associated with the cn functionality of each i/o port. the cnenx registers contain the cn interrupt enable control bits for each of the input pins. setting any of these bits enables a cn interrupt for the corresponding pins. each i/o pin also has a weak pull-up and a weak pull-down connected to it. the pull-ups and pull- downs act as a current source or sink source connected to the pin, and eliminate the need for external resistors when push-button or keypad devices are connected. the pull-ups and pull-downs are enabled separately using the cnpux and the cnpdx registers, which contain the control bits for each of the pins. setting any of the control bits enables the weak pull-ups and/or pull-downs for the corresponding pins. example 11-1: port write/read example note: pull-ups and pull-downs on change notifi- cation pins should always be disabled when the port pin is configured as a digital output. mov 0xff00, w0 ; configure portb<15:8> ; as inputs mov w0, trisb ; and portb<7:0> ; as outputs nop ; delay 1 cycle btss portb, #13 ; next instruction
? 2011 microchip technology inc. preliminary ds70657d-page 167 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 11.4 peripheral pin select a major challenge in general purpose devices is provid- ing the largest possible set of peripheral features while minimizing the conflict of features on i/o pins. the chal- lenge is even greater on low pin-count devices. in an application where more than one peripheral needs to be assigned to a single pin, inconvenient workarounds in application code or a complete redesign may be the only option. peripheral pin select configuration provides an alternative to these choices by enabling peripheral set selection and their placement on a wide range of i/o pins. by increasing the pinout options available on a particular device, users can better tailor the device to their entire application, rather than trimming the application to fit the device. the peripheral pin select configuration feature oper- ates over a fixed subset of digital i/o pins. users may independently map the input an d/or output of most dig- ital peripherals to any one of these i/o pins. hardware safeguards are included that prevent accidental or spurious changes to the per ipheral mapping once it has been established. 11.4.1 available pins the number of available pins is dependent on the particular device and its pin co unt. pins that support the peripheral pin select feature include the designation, ?rpn? or ?rpin?, in their full pin designation, where ?n? is the remappable pin number. ?rp? is used to designate pins that support both remappable input and output functions, while ?rpi? indicates pins that support remappable input functions only. 11.4.2 available peripherals the peripherals managed by the peripheral pin select are all digital-only peripherals. these include general serial communications (uart and spi), general pur- pose timer clock inputs, time r-related peripherals (input capture and output compare) and interrupt-on-change inputs. in comparison, some digital-only peripheral modules are never included in the peri pheral pin select feature. this is because the peripheral?s function requires spe- cial i/o circuitry on a specific port and cannot be easily connected to multiple pins. these modules include i 2 c and the pwm. a similar requirement excludes all mod- ules with analog inputs, such as the a/d converter. a key difference between remappable and non-remap- pable peripherals is that remappable peripherals are not associated with a default i/o pin. the peripheral must always be assigned to a specific i/o pin before it can be used. in contrast, non-remappable peripherals are always available on a defau lt pin, assuming that the peripheral is active and not conflicting with another peripheral. when a remappable peripheral is active on a given i/o pin, it takes priority over all other digital i/o and digital communication peripherals associated with the pin. priority is given regardless of the type of peripheral that is mapped. remappable peripherals never take priority over any analog functions associated with the pin. 11.4.3 controlling peripheral pin select peripheral pin select features are controlled through two sets of sfrs: one to map peripheral inputs, and one to map outputs. because they are separately con- trolled, a particular peripher al?s input and output (if the peripheral has both) can be placed on any selectable function pin without constraint. the association of a peripheral to a peripheral-select- able pin is handled in two different ways, depending on whether an input or output is being mapped. 11.4.4 input mapping the inputs of the peripheral pin select options are mapped on the basis of the peripheral. that is, a control register associated with a peripheral dictates the pin it will be mapped to. the rpinrx registers are used to configure peripheral input mapping (see register 11-1 through register 11-17 ). each register contains sets of 7-bit fields, with each set associated with one of the remappable peripherals. programming a given periph- eral?s bit field with an appropriate 7-bit value maps the rpn pin with the corresponding value to that peripheral. for any given device, the valid range of values for any bit field corresponds to the maximum number of peripheral pin selections supported by the device. for example, figure 11-2 illustrates remappable pin selection for the u1rx input. figure 11-2: remappable input for u1rx rp0 rp1 rp3 0 1 2 u1rx input u1rxr<6:0> to peripheral rpn n note: for input only, peripheral pin select functionality does not have priority over trisx settings. therefore, when configuring rpn pin for input, the corresponding bit in the trisx register must also be configured for input (set to ? 1 ?).
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 168 preliminary ? 2011 microchip technology inc. 11.4.4.1 virtual connections DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x devices support virtual (internal) connections to the output of the op amp/ comparator module (see figure 25-1 in section 25.0 ?op amp/comparator module? ) and the ptg module (see section 24.0 ?peripheral trigger generator (ptg) module? ). in addition, dspic3 3epxxxmc20x/50x and pic24epxxxmc20x devices su pport virtual connec- tions to the filtered qei module inputs findx1, fhome1, findx2 and fhome2 (see figure 17-1 in section 17.0 ?quadrature encoder interface (qei) module (dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only)? . virtual connections provide a simple way of inter- peripheral connection without utilizing a physical pin. for example, by setting the flt1r<6:0> bits of the rpinr12 register to the value of ?b0000001 , the output of the analog comparator c1out will be connected to the pwm fault 1 input, which allows the analog comparator to trigger pwm faults without the use of an actual physical pin on the device. virtual connection to the qei module allows peripherals to be connect ed to the qei digital filter input. to utilize this filter, the qei module must be enabled, and its inputs must be connected to a physical rpn pin. example 11-2 illustrates how the input capture module can be connected to the qei digital filter. example 11-2: connecting ic1 to the home1 qei1 digital filter input on pin 43 of the dspic33epxxxmc206 device rpinr15 = 0x2500; /* connect the qei1 home1 input to rp37 (pin 43) */ rpinr7 = 0x009; /* connect the ic1 input to the digital filter on the fhome1 input */ qei1ioc = 0x4000; /* enable the qei digital filter */ qei1con = 0x8000; /* enable the qei module */ table 11-1: selectable input so urces (maps input to function) input name (1) function name register configuration bits external interrupt 1 int1 rpinr0 int1r<6:0> external interrupt 2 int2 rpinr1 int2r<6:0> timer2 external clock t2ck rpinr3 t2ckr<6:0> input capture 1 ic1 rpinr7 ic1r<6:0> input capture 2 ic2 rpinr7 ic2r<6:0> input capture 3 ic3 rpinr8 ic3r<6:0> input capture 4 ic4 rpinr8 ic4r<6:0> output compare fault a ocfa rpinr11 ocfar<6:0> pwm fault 1 (3) flt1 rpinr12 flt1r<6:0> pwm fault 2 (3) flt2 rpinr12 flt2r<6:0> qei1 phase a (3) qea1 rpinr14 qea1r<6:0> qei1 phase b (3) qeb1 rpinr14 qeb1r<6:0> qei1 index (3) indx1 rpinr15 indx1r<6:0> qei1 home (3) home1 rpinr15 hom1r<6:0> uart1 receive u1rx rpinr18 u1rxr<6:0> uart2 receive u2rx rpinr19 u2rxr<6:0> spi2 data input sdi2 rpinr22 sdi2r<6:0> spi2 clock input sck2 rpinr22 sck2r<6:0> spi2 slave select ss2 rpinr23 ss2r<6:0> can1 receive (2) c1rx rpinr26 c1rxr<6:0> pwm synch input 1 (3) synci1 rpinr37 synci1r<6:0> pwm dead time compensation 1 (3) dtcmp1 rpinr38 dtcmp1r<6:0> pwm dead time compensation 2 (3) dtcmp2 rpinr39 dtcmp2r<6:0> pwm dead time compensation 3 (3) dtcmp3 rpinr39 dtcmp3r<6:0> note 1: unless otherwise noted, all inputs use the schmitt input buffers. 2: this input source is available on dspic33epxxxg p/mc50x devices only. 3: this input source is available on dspic33 epxxxmc20x/50x and pic24 epxxxmc20x devices only.
? 2011 microchip technology inc. preliminary ds70657d-page 169 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x table 11-2: input pin selection for selectable input sources peripheral pin select input register value input/ output pin assignment peripheral pin select input register value input/ output pin assignment 000 0000 ivss 010 1101 irpi45 000 0001 ic1out (1) 010 1110 irpi46 000 0010 ic2out (1) 010 1111 irpi47 000 0011 ic3out (1) 011 0000 ? ? 000 0100 ic4out (1) 011 0001 ? ? 000 0101 ? ? 011 0010 ? ? 000 0110 iptgo30 (1) 011 0011 irpi51 000 0111 iptgo31 (1) 011 0100 irpi52 000 1000 i findx1 (1,2) 011 0101 irpi53 000 1001 ifhome1 (1,2) 011 0110 i/o rp54 000 1010 ? ? 011 0111 i/o rp55 000 1011 ? ? 011 1000 i/o rp56 000 1100 ? ? 011 1001 i/o rp57 000 1101 ? ? 011 1010 irpi58 000 1110 ? ? 011 1011 ? ? 000 1111 ? ? 011 1100 ? ? 001 0000 ? ? 011 1101 ? ? 001 0001 ? ? 011 1110 ? ? 001 0010 ? ? 011 1111 ? ? 001 0011 ? ? 100 0000 ? ? 001 0100 i/o rp20 100 0001 ? ? 001 0101 ? ? 100 0010 ? ? 001 0110 ? ? 100 0011 ? ? 001 0111 ? ? 100 0100 ? ? 001 1000 irpi24 100 0101 ? ? 001 1001 irpi25 100 0110 ? ? 001 1010 ? ? 100 0111 ? ? 001 1011 irpi27 100 1000 ? ? 001 1100 irpi28 100 1001 ? ? 001 1101 ? ? 100 1010 ? ? 001 1110 ? ? 100 1011 ? ? 001 1111 ? ? 100 1100 ? ? 010 0000 irpi32 100 1101 ? ? 010 0001 irpi33 100 1110 ? ? 010 0010 irpi34 100 1111 ? ? 010 0011 i/o rp35 101 0000 ? ? 010 0100 i/o rp36 101 0001 ? ? 010 0101 i/o rp37 101 0010 ? ? 010 0110 i/o rp38 101 0011 ? ? 010 0111 i/o rp39 101 0100 ? ? 010 1000 i/o rp40 101 0101 ? ? 010 1001 i/o rp41 101 0110 ? ? 010 1010 i/o rp42 101 0111 ? ? 010 1011 i/o rp43 101 1000 ? ? 010 1100 irpi44 101 1001 ? ? note 1: see section 11.4.4.1 ?virtual connections? for more information on selecting this pin assignment. 2: these inputs are available on dspic33epxxxgp/mc50x devices only.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 170 preliminary ? 2011 microchip technology inc. 101 1010 ? ? 110 1101 ? ? 101 1011 ? ? 110 1110 ? ? 101 1100 ? ? 110 1111 ? ? 101 1101 ? ? 111 0000 ? ? 101 1110 irpi94 111 0001 ? ? 101 1111 irpi95 111 0010 ? ? 110 0000 irpi96 111 0011 ? ? 110 0001 i/o rp97 111 0100 ? ? 110 0010 ? ? 111 0101 ? ? 110 0011 ? ? 111 0110 i/o rp118 110 0100 ? ? 111 0111 irpi119 110 0101 ? ? 111 1000 i/o rp120 110 0110 ? ? 111 1001 i rpi121 110 0111 ? ? 111 1010 ? ? 110 1000 ? ? 111 1011 ? ? 110 1001 ? ? 111 1100 ? ? 110 1010 ? ? 111 1101 ? ? 110 1011 ? ? 111 1110 ? ? 110 1100 ? ? 111 1111 ? ? table 11-2: input pin selection for selectable input sources (continued) peripheral pin select input register value input/ output pin assignment peripheral pin select input register value input/ output pin assignment note 1: see section 11.4.4.1 ?virtual connections? for more information on selecting this pin assignment. 2: these inputs are available on dspic33epxxxgp/mc50x devices only.
? 2011 microchip technology inc. preliminary ds70657d-page 171 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 11.4.4.2 output mapping in contrast to inputs, the outputs of the peripheral pin select options are mapped on the basis of the pin. in this case, a control register associated with a particular pin dictates the peripheral output to be mapped. the rporx registers are used to control output mapping. like the rpinrx registers, each register contains sets of 6 bit fields, with each set associated with one rpn pin (see register 11-18 through register 11-27 ). the value of the bit field corresponds to one of the periph- erals, and that peripheral?s output is mapped to the pin (see table 11-3 and figure 11-3 ). a null output is associated wit h the output register reset value of ?0?. this is done to ensure that remappable out- puts remain disconnected from all output pins by default. figure 11-3: multiplexing remappable output for rpn 11.4.4.3 mapping limitations the control schema of the peripheral select pins is not limited to a small range of fixed peripheral configura- tions. there are no mutual or hardware-enforced lock- outs between any of the peripheral mapping sfrs. literally any combination of peripheral mappings across any or all of the rpn pins is possible. this includes both many-to-one and one-to-many mappings of peripheral inputs and outputs to pins. while such mappings may be technically possible from a configu- ration point of view, they may not be supportable from an electrical point of view. rpnr<5:0> 0 49 1 default u1tx output sdo2 output 2 refclko output 48 qei1ccmp output output data rpn table 11-3: output selection for remappable pins (rpn) function rpnr<5:0> output name default port 000000 rpn tied to default pin u1tx 000001 rpn tied to uart1 transmit u2tx 000011 rpn tied to uart2 transmit sdo2 001000 rpn tied to spi2 data output sck2 001001 rpn tied to spi2 clock output ss2 001010 rpn tied to spi2 slave select c1tx (2) 001110 rpn tied to can1 transmit oc1 010000 rpn tied to output compare 1 output oc2 010001 rpn tied to output compare 2 output oc3 010010 rpn tied to output compare 3 output oc4 010011 rpn tied to output compare 4 output c1out 011000 rpn tied to comparator output 1 c2out 011001 rpn tied to comparator output 2 c3out 011010 rpn tied to comparator output 3 synco1 (1) 101101 rpn tied to pwm primary time base sync output qei1ccmp (1) 101111 rpn tied to qei 1 counter comparator output refclko 110001 rpn tied to reference clock output c4out 110010 rpn tied to comparator output 4 note 1: this function is available in dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only. 2: this function is available in dspic33epxxxgp/mc50x devices only.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 172 preliminary ? 2011 microchip technology inc. 11.5 i/o helpful tips 1. in some cases, certain pins as defined in table 30- 10 under ?injection current?, have internal protec- tion diodes to v dd and v ss . the term ?injection current? is also referred to as ?clamp current?. on designated pins, with sufficient external current limiting precautions by the user, i/o pin input volt- ages are allowed to be greater or less than the data sheet absolute maximum ratings with respect to the v ss and v dd supplies. note that when the user application forward biases either of the high or low side internal input clamp diodes, that the resulting current being injected into the device that is clamped internally by the v dd and v ss power rails, may affect the adc accuracy by four to six counts. 2. i/o pins that are shared with any analog input pin, (i.e., anx), are always analog pins by default after any reset. consequently, configuring a pin as an analog input pin, automatical ly disables the digital input pin buffer and any attempt to read the digital input level by reading portx or latx will always return a ? 0 ? regardless of the digital logic level on the pin. to use a pin as a digital i/o pin on a shared anx pin, the user application needs to configure the analog pin configuration registers in the i/o ports module, (i.e., anselx), by setting the appro- priate bit that corresponds to that i/o port pin to a ? 1 ?. 3. most i/o pins have multiple functions. referring to the device pin diagrams in the data sheet, the pri- orities of the functions allocated to any pins are indicated by reading the pin name from left-to- right. the left most function name takes prece- dence over any function to its right in the naming convention. for exampl e: an16/t2ck/t7ck/rc1. this indicates that an16 is the highest priority in this example and will supersede all other functions to its right in the list. those other functions to its right, even if enabled, w ould not work as long as any other function to its left was enabled. this rule applies to all of the functions listed for a given pin. 4. each pin has an internal weak pull-up resistor and pull-down resistor that can be configured using the cnpux and cnpdx registers, respec- tively. these resistors eliminate the need for external resistors in certain applications. the internal pull-up is up to ~(v dd -0.8), not v dd . this value is still above the minimum v ih of cmos and ttl devices. 5. when driving leds directly, the i/o pin can source or sink more current than what is specified in the v oh /i oh and v ol /i ol dc characteristic specifica- tion. the respective i oh and i ol current rating only applies to maintaining the corresponding output at or above the v oh and at or below the v ol levels. however, for leds unlike digital inputs of an exter- nally connected device, they are not governed by the same minimum v ih /v il levels. an i/o pin out- put can safely sink or s ource any current less than that listed in the absolute maximum rating section of the data sheet. for example: v oh = 2.4v @ i oh = -8 ma and v dd = 3.3v the maximum output current sourced by any 8 ma i/o pin = 12 ma. led source current < 12 ma is technically permitted. refer to the v oh /i oh graphs in section 30.0 ?electrical characteristics? for additional information. 11.6 i/o ports resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 11.6.1 key resources ? section 2. ?i/o ports? (ds70598) ? code samples ? application notes ? software libraries ? webinars ? all related dspic33e/pic24e family reference manuals sections ? development tools note: although it is not possible to use a digital input pin when its analog function is enabled, it is possible to use the digital i/o output function, tris x = 0x0, while the analog function is also enabled. however, this is not recommended , particularly if the analog input is connected to an external analog voltage source, which would cre- ate signal contention between the analog signal and the output pin driver. note: in the event you are not able to access the product page using the link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
? 2011 microchip technology inc. preliminary ds70657d-page 173 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 11.7 peripheral pin select registers register 11-1: rpinr0: peripheral pin select input register 0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ?int1r<6:0> bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-8 int1r<6:0>: assign external interrupt 1 (int1) to the corresponding rpn pin bits (see ta b l e 11 - 2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss bit 7-0 unimplemented: read as ? 0 ?
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 174 preliminary ? 2011 microchip technology inc. register 11-2: rpinr1: peripheral pin select input register 1 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ?int2r<6:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-7 unimplemented: read as ? 0 ? bit 6-0 int2r<6:0>: assign external interrupt 2 (int2) to the corresponding rpn pin bits (see ta b l e 11 - 2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss
? 2011 microchip technology inc. preliminary ds70657d-page 175 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 11-3: rpinr3: peripheral pin select input register 3 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ?t2ckr<6:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-7 unimplemented: read as ? 0 ? bit 6-0 t2ckr<6:0>: assign timer2 external clock (t2ck) to the corresponding rpn pin bits (see ta b l e 11 - 2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 176 preliminary ? 2011 microchip technology inc. register 11-4: rpinr7: peripheral pin select input register 7 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ic2r<6:0> bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ic1r<6:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-8 ic2r<6:0>: assign input capture 2 (ic2) to the corresponding rpn pin bits (see ta b l e 11 - 2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss bit 7 unimplemented: read as ? 0 ? bit 6-0 ic1r<6:0>: assign input capture 1 (ic1) to the corresponding rpn pin bits (see ta b l e 11 - 2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss
? 2011 microchip technology inc. preliminary ds70657d-page 177 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 11-5: rpinr8: peripheral pin select input register 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ic4r<6:0> bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ic3r<6:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-8 ic4r<6:0>: assign input capture 4 (ic4) to the corresponding rpn pin bits (see ta b l e 11 - 2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss bit 7 unimplemented: read as ? 0 ? bit 6-0 ic3r<6:0>: assign input capture 3 (ic3) to the corresponding rpn pin bits (see ta b l e 11 - 2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 178 preliminary ? 2011 microchip technology inc. register 11-6: rpinr11: peripheral pin select input register 11 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ?ocfar<6:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-7 unimplemented: read as ? 0 ? bit 6-0 ocfar<6:0>: assign output compare fault a (ocfa) to the corresponding rpn pin bits (see ta b l e 11 - 2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss
? 2011 microchip technology inc. preliminary ds70657d-page 179 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 11-7: rpinr12: peripheral pin select input register 12 (dspic33epxxxmc20x/50x and pi c24epxxxmc20x devices only) u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ?flt2r<6:0> bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ?flt1r<6:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-8 flt2r<6:0>: assign pwm fault 2 (flt2 ) to the corresponding rpn pin bits (see ta b l e 11 - 2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss bit 7 unimplemented: read as ? 0 ? bit 6-0 flt1r<6:0>: assign pwm fault 1 (flt1 ) to the corresponding rpn pin bits (see ta b l e 11 - 2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 180 preliminary ? 2011 microchip technology inc. register 11-8: rpinr14: peripheral pin select input register 14 (dspic33epxxxmc20x/50x and pi c24epxxxmc20x devices only) u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? qeb1r<6:0> bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? qea1r<6:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-8 qeb1r<6:0>: assign b (qeb) to the corresponding rpn pin bits (see ta b l e 11 - 2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss bit 7 unimplemented: read as ? 0 ? bit 6-0 qea1r<6:0>: assign a (qea) to the corresponding rpn pin bits (see ta b l e 11 - 2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss
? 2011 microchip technology inc. preliminary ds70657d-page 181 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 11-9: rpinr15: peripheral pin select input register 15 (dspic33epxxxmc20x/50x and pi c24epxxxmc20x devices only) u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? home1r<6:0> bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? indx1r<6:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-8 home1r<6:0>: assign qei1 home1 (home1) to the corresponding rpn pin bits (see ta b l e 11 - 2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss bit 7 unimplemented: read as ? 0 ? bit 6-0 ind1xr<6:0>: assign qei1 index1 (indx1) to the corresponding rpn pin bits (see ta b l e 11 - 2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 182 preliminary ? 2011 microchip technology inc. register 11-10: rpinr18: peripheral pin select input register 18 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ?u1rxr<6:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-7 unimplemented: read as ? 0 ? bit 6-0 u1rxr<6:0>: assign uart1 receive (u1rx) to the corresponding rpn pin bits (see ta b l e 11 - 2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss
? 2011 microchip technology inc. preliminary ds70657d-page 183 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 11-11: rpinr19: peripheral pin select input register 19 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ?u2rxr<6:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-7 unimplemented: read as ? 0 ? bit 6-0 u2rxr<6:0>: assign uart2 receive (u2rx) to the corresponding rpn pin bits (see ta b l e 11 - 2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 184 preliminary ? 2011 microchip technology inc. register 11-12: rpinr22: peripheral pin select input register 22 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? sck2<6:0> bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? sdi2<6:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-8 sck2 <6:0>: assign spi2 clock input (sck2) to the corresponding rpn pin bits (see ta b l e 11 - 2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss bit 7 unimplemented: read as ? 0 ? bit 6-0 sdi2 <6:0>: assign spi2 data input (sdi2) to the corresponding rpn pin bits (see ta b l e 11 - 2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss
? 2011 microchip technology inc. preliminary ds70657d-page 185 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 11-13: rpinr23: peripheral pin select input register 23 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ss2<6:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 6-0 ss2 <6:0>: assign spi2 slave select (ss2 ) to the corresponding rpn pin bits (see ta b l e 11 - 2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 186 preliminary ? 2011 microchip technology inc. register 11-14: rpinr26: peripheral pin select input register 26 (dspic33epxxxgp/mc50x devices only) u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ?c1rxr<6:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-7 unimplemented: read as ? 0 ? bit 6-0 c1rxr<6:0>: assign can1 rx input (crx1) to the corresponding rpn pin bits (see ta b l e 11 - 2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss
? 2011 microchip technology inc. preliminary ds70657d-page 187 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 11-15: rpinr37: peripheral pin select input register 37 (dspic33epxxxmc20x/50x and pic 24epxxxmc20x devices only) u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? synci1r<6:0> bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-8 synci1r<6:0>: assign pwm synchronization input 1 to the corresponding rpn pin bits (see ta b l e 11 - 2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss bit 7-0 unimplemented: read as ? 0 ?
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 188 preliminary ? 2011 microchip technology inc. register 11-16: rpinr38: peripheral pin select input register 38 (dspic33epxxxmc02x and pic2 4epxxxmc20x devices only) u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ?dtcmp1r<6:0> bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-8 dtcmp1r<6:0>: assign pwm dead time compensation input 1 to the corresponding rpn pin bits (see ta b l e 11 - 2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss bit 7-0 unimplemented: read as ? 0 ?
? 2011 microchip technology inc. preliminary ds70657d-page 189 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 11-17: rpinr39: peripheral pin select input register 39 (dspic33epxxxmc20x/50x and pic 24epxxxmc20x devices only) u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ?dtcmp3r<6:0> bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ?dtcmp2r<6:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-8 dtcmp3r<6:0>: assign pwm dead time compensation input 3 to the corresponding rpn pin bits (see ta b l e 11 - 2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss bit 7 unimplemented: read as ? 0 ? bit 6-0 dtcmp2r<6:0>: assign pwm dead time compensation input 2 to the corresponding rpn pin bits (see ta b l e 11 - 2 for input pin selection numbers) 1111001 = input tied to rpi121 . . . 0000001 = input tied to cmp1 0000000 = input tied to v ss
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 190 preliminary ? 2011 microchip technology inc. register 11-18: rpor0: peripheral pin select output register 0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? rp35r<5:0> bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? rp20r<5:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13-8 rp35r<5:0>: peripheral output function is assi gned to rp35 output pin bits (see ta b l e 11 - 3 for peripheral function numbers) bit 7-6 unimplemented: read as ? 0 ? bit 5-0 rp20r<5:0>: peripheral output function is a ssigned to rp20 output pin bits (see ta b l e 11 - 3 for peripheral function numbers) register 11-19: rpor1: peripheral pin select output register 1 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? rp37r<5:0> bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? rp36r<5:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13-8 rp37r<5:0>: peripheral output function is assi gned to rp37 output pin bits (see ta b l e 11 - 3 for peripheral function numbers) bit 7-6 unimplemented: read as ? 0 ? bit 5-0 rp36r<5:0>: peripheral output function is a ssigned to rp36 output pin bits (see ta b l e 11 - 3 for peripheral function numbers)
? 2011 microchip technology inc. preliminary ds70657d-page 191 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 11-20: rpor2: peripheral pin select output register 2 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? rp39r<5:0> bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? rp38r<5:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13-8 rp39r<5:0>: peripheral output function is assi gned to rp39 output pin bits (see ta b l e 11 - 3 for peripheral function numbers) bit 7-6 unimplemented: read as ? 0 ? bit 5-0 rp38r<5:0>: peripheral output function is a ssigned to rp38 output pin bits (see ta b l e 11 - 3 for peripheral function numbers) register 11-21: rpor3: peripheral pin select output register 3 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? rp41r<5:0> bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? rp40r<5:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13-8 rp41r<5:0>: peripheral output function is assi gned to rp41 output pin bits (see ta b l e 11 - 3 for peripheral function numbers) bit 7-6 unimplemented: read as ? 0 ? bit 5-0 rp40r<5:0>: peripheral output function is a ssigned to rp40 output pin bits (see ta b l e 11 - 3 for peripheral function numbers)
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 192 preliminary ? 2011 microchip technology inc. register 11-22: rpor4: peripheral pin select output register 4 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? rp43r<5:0> bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? rp42r<5:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13-8 rp43r<5:0>: peripheral output function is assi gned to rp43 output pin bits (see ta b l e 11 - 3 for peripheral function numbers) bit 7-6 unimplemented: read as ? 0 ? bit 5-0 rp42r<5:0>: peripheral output function is a ssigned to rp42 output pin bits (see ta b l e 11 - 3 for peripheral function numbers) register 11-23: rpor5: peripheral pin select output register 5 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? rp55r<5:0> bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? rp54r<5:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13-8 rp55r<5:0>: peripheral output function is assi gned to rp55 output pin bits (see ta b l e 11 - 3 for peripheral function numbers) bit 7-6 unimplemented: read as ? 0 ? bit 5-0 rp54r<5:0>: peripheral output function is a ssigned to rp54 output pin bits (see ta b l e 11 - 3 for peripheral function numbers)
? 2011 microchip technology inc. preliminary ds70657d-page 193 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 11-24: rpor6: peripheral pin select output register 6 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? rp57r<5:0> bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? rp56r<5:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13-8 rp57r<5:0>: peripheral output function is assi gned to rp57 output pin bits (see ta b l e 11 - 3 for peripheral function numbers) bit 7-6 unimplemented: read as ? 0 ? bit 5-0 rp56r<5:0>: peripheral output function is a ssigned to rp56 output pin bits (see ta b l e 11 - 3 for peripheral function numbers) register 11-25: rpor7: peripheral pin select output register 7 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? rp97r<5:0> bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13-8 rp97r<5:0>: peripheral output function is assi gned to rp97 output pin bits (see ta b l e 11 - 3 for peripheral function numbers) bit 7-0 unimplemented: read as ? 0 ?
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 194 preliminary ? 2011 microchip technology inc. register 11-26: rpor8: peripheral pin select output register 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? rp118r<5:0> bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13-8 rp118r<5:0>: peripheral output function is assig ned to rp118 output pin bits (see ta b l e 11 - 3 for peripheral function numbers) bit 7-0 unimplemented: read as ? 0 ? register 11-27: rpor9: peripheral pin select output register 9 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? rp120r<5:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-6 unimplemented: read as ? 0 ? bit 5-0 rp120r<5:0>: peripheral output function is assigned to rp120 output pin bits (see table 11-3 for peripheral function numbers)
? 2011 microchip technology inc. preliminary ds70657d-page 195 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 12.0 timer1 the timer1 module is a 16-b it timer that can operate as a free-running interval timer/counter. the timer1 module has the following unique features over other timers: ? can be operated in asynchronous counter mode from an external clock source ? the external clock input (t1ck) can optionally be synchronized to the internal device clock and the clock synchronization is performed after the prescaler a block diagram of ti mer1 is shown in figure 12-1 . the timer1 module can operate in one of the following modes: ? timer mode ? gated timer mode ? synchronous counter mode ? asynchronous counter mode in timer and gated timer modes, the input clock is derived from the internal instruction cycle clock (f cy ). in synchronous and asynchronous counter modes, the input clock is derived from the external clock input at the t1ck pin. the timer modes are determined by the following bits: ? timer clock source control bit (tcs): t1con<1> ? timer synchronization control bit (tsync): t1con<2> ? timer gate control bit (tgate): t1con<6> timer control bit setting for different operating modes are given in the table 12-1 . table 12-1: timer mode settings figure 12-1: 16-bit timer1 module block diagram note 1: this data sheet summ arizes the features of the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x families of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to section 11. ?timers? (ds70362) of the ? dspic33e/pic24e family reference manual ?, which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for de vice-specific register and bit information. mode tcs tgate tsync timer 00x gated timer 01x synchronous counter 1x1 asynchronous counter 1x0 tgate tcs 00 10 x1 tmr1 comparator pr1 tgate set t1if flag 0 1 tsync 1 0 sync equal reset t1ck prescaler (/n) tckps<1:0> gate sync f p (1) falling edge detect prescaler (/n) tckps<1:0> note 1: f p is the peripheral clock. latch data clk t1clk ctmu edge-control logic
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 196 preliminary ? 2011 microchip technology inc. 12.1 timer1 resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 12.1.1 key resources ? section 11. ?timers? (ds70362) ? code samples ? application notes ? software libraries ? webinars ? all related dspic33e/pic24e family reference manuals sections ? development tools note: in the event you are not able to access the product page using t he link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
? 2011 microchip technology inc. preliminary ds70657d-page 197 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 12.2 timer1 control register register 12-1: t1con: timer1 control register r/w-0 u-0 r/w-0 u-0 u-0 u-0 u-0 u-0 ton (1) ?tsidl ? ? ? ? ? bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 u-0 r/w-0 r/w-0 u-0 ? tgate tckps<1:0> ? tsync (1) tcs (1) ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 ton: timer1 on bit 1 = starts 16-bit timer1 0 = stops 16-bit timer1 bit 14 unimplemented: read as ? 0 ? bit 13 tsidl: stop in idle mode bit 1 = discontinue module operation when device enters idle mode 0 = continue module operation in idle mode bit 12-7 unimplemented: read as ? 0 ? bit 6 tgate: timer1 gated time accumulation enable bit when tcs = 1 : this bit is ignored. when tcs = 0 : 1 = gated time accumulation enabled 0 = gated time accumulation disabled bit 5-4 tckps<1:0>: timer1 input clock prescale select bits 11 = 1:256 10 = 1:64 01 = 1:8 00 = 1:1 bit 3 unimplemented: read as ? 0 ? bit 2 tsync: timer1 external clock input synchronization select bit when tcs = 1 : 1 = synchronize external clock input 0 = do not synchronize external clock input when tcs = 0 : this bit is ignored. bit 1 tcs: timer1 clock source select bit 1 = external clock from pin t1ck (on the rising edge) 0 = internal clock (f p ) bit 0 unimplemented: read as ? 0 ? note 1: when timer1 is enabled in external synchronous counter mode (tcs = 1 , tsync = 1 , ton = 1 ), any attempts by user software to writ e to the tmr1 register is ignored.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 198 preliminary ? 2011 microchip technology inc. notes:
? 2011 microchip technology inc. preliminary ds70657d-page 199 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 13.0 timer2/3 and timer4/5 the timer2/3 and timer4/5 modules are 32-bit timers, which can also be configured as four independent 16-bit timers with selectable operating modes. as a 32-bit timer, timer2/3 and timer4/5 operate in three modes: ? two independent 16-bit timers (e.g., timer2 and timer3) with all 16-bit operating modes (except asynchronous counter mode) ? single 32-bit timer ? single 32-bit synchronous counter they also suppor t these features: ? timer gate operation ? selectable prescaler settings ? timer operation during idle and sleep modes ? interrupt on a 32-bit period register match ? time base for input capture and output compare modules (timer2 and timer3 only) ? adc1 event trigger (timer2/3 only) individually, all four of the 16-bit timers can function as synchronous timers or counters. they also offer the features listed above, exce pt for the event trigger; this is implemented only with timer2/3. the operating modes and enabled features are determined by setting the appropriate bit(s) in the t2con, t3con, and t4con, t5con registers. t2con and t4con are shown in generic form in register 13-1 . t3con and t5con are shown in register 13-2 . for 32-bit timer/counter operation, timer2 and timer4 are the least significant word (lsw); timer3 and timer5 are the most significant word (msw) of the 32-bit timers. a block diagram for an example 32-bit timer pair (timer2/3 and timer4/5) is shown in figure 13-3 . note 1: this data sheet summ arizes the features of the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x family of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to section 11. ?timers? (ds70362) of the ?dspic33e/pic24e family reference manual? , which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for de vice-specific register and bit information. note: for 32-bit operation, t3con and t5con control bits are ignored. only t2con and t4con control bits are used for setup and control. timer2 and timer4 clock and gate inputs are utilized for the 32-bit timer mod- ules, but an interrupt is generated with the timer3 and timer5 interrupt flags. note: only timer2, 3, 4 and 5 can trigger a dma data transfer.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 200 preliminary ? 2011 microchip technology inc. figure 13-1: type b timer block diagram (x = 2 and 4) figure 13-2: type c timer bl ock diagram (x = 3 and 5) tgate tcs 00 10 x1 tmrx comparator prx tgate set txif flag 0 1 sync equal reset txck prescaler (/n) tckps<1:0> gate sync f p (1) falling edge detect prescaler (/n) tckps<1:0> note 1: f p is the peripheral clock. latch data clk txclk tgate tcs 00 10 x1 tmrx comparator prx tgate set txif flag 0 1 sync equal reset txck prescaler (/n) tckps<1:0> gate sync f p (1) falling edge detect prescaler (/n) tckps<1:0> note 1: f p is the peripheral clock. 2: the adc trigger is available on tmr3 and tmr5 only. latch data clk txclk adc start of conversion trigger (2)
? 2011 microchip technology inc. preliminary ds70657d-page 201 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x figure 13-3: type b/type c timer pa ir block diagra m (32-bit timer) 13.1 timer resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 13.1.1 key resources ? section 11. ?timers? (ds70362) ? code samples ? application notes ? software libraries ? webinars ? all related dspic33e/pic24e family reference manuals sections ? development tools tgate tcs 00 10 x1 tmrx comparator tgate set tyif flag 0 1 sync equal reset txck prescaler (/n) tckps<1:0> gate sync f p (1) falling edge detect prescaler (/n) tckps<1:0> note 1: the adc trigger is available only on the tmr3:tmr2 andtmr5:tmr4 32-bit timer pairs. 2: timerx is a type b timer (x = 2 and 4). 3: timery is a type c timer (x = 3 and 5). latch data clk tmry adc prx pry tmryhld data bus<15:0> msw lsw note: in the event you are not able to access the product page using the link above, enter this url in your browser: http://www.microchip.com/wwwprod- ucts/devices.aspx?ddoc- name=en555464
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 202 preliminary ? 2011 microchip technology inc. 13.2 timer control registers register 13-1: txcon (t2con and t4con) control register r/w-0 u-0 r/w-0 u-0 u-0 u-0 u-0 u-0 ton ?tsidl ? ? ? ? ? bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 u-0 r/w-0 u-0 ? tgate tckps<1:0> t32 ?tcs (1) ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 ton: timerx on bit when t32 = 1 : 1 = starts 32-bit timerx/y 0 = stops 32-bit timerx/y when t32 = 0 : 1 = starts 16-bit timerx 0 = stops 16-bit timerx bit 14 unimplemented: read as ? 0 ? bit 13 tsidl: stop in idle mode bit 1 = discontinue module operation when device enters idle mode 0 = continue module operation in idle mode bit 12-7 unimplemented: read as ? 0 ? bit 6 tgate: timerx gated time accumulation enable bit when tcs = 1 : this bit is ignored. when tcs = 0 : 1 = gated time accumulation enabled 0 = gated time accumulation disabled bit 5-4 tckps<1:0>: timerx input clock prescale select bits 11 = 1:256 10 = 1:64 01 = 1:8 00 = 1:1 bit 3 t32: 32-bit timer mode select bit 1 = timerx and timery form a single 32-bit timer 0 = timerx and timery act as two 16-bit timers bit 2 unimplemented: read as ? 0 ? bit 1 tcs: timerx clock source select bit (1) 1 = external clock from pin txck (on the rising edge) 0 = internal clock (f p ) bit 0 unimplemented: read as ? 0 ? note 1: the txck pin is not available on all timers. refer to the ? pin diagrams ? section for the available pins.
? 2011 microchip technology inc. preliminary ds70657d-page 203 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 13-2: tycon (t3con and t5con) control register r/w-0 u-0 r/w-0 u-0 u-0 u-0 u-0 u-0 ton (1) ?tsidl (2) ? ? ? ? ? bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 u-0 u-0 r/w-0 u-0 ?tgate (1) tckps<1:0> (1) ? ?tcs (1,3) ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 ton: timery on bit (1) 1 = starts 16-bit timery 0 = stops 16-bit timery bit 14 unimplemented: read as ? 0 ? bit 13 tsidl: stop in idle mode bit (2) 1 = discontinue module operation when device enters idle mode 0 = continue module operation in idle mode bit 12-7 unimplemented: read as ? 0 ? bit 6 tgate: timery gated time accumulation enable bit (1) when tcs = 1 : this bit is ignored. when tcs = 0 : 1 = gated time accumulation enabled 0 = gated time accumulation disabled bit 5-4 tckps<1:0>: timery input clock prescale select bits (1) 11 = 1:256 10 = 1:64 01 = 1:8 00 = 1:1 bit 3-2 unimplemented: read as ? 0 ? bit 1 tcs: timery clock source select bit (1,3) 1 = external clock from pin tyck (on the rising edge) 0 = internal clock (f p ) bit 0 unimplemented: read as ? 0 ? note 1: when 32-bit operation is enabled (t2con<3> = 1 ), these bits have no effect on timery operation; all timer functions are set through txcon. 2: when 32-bit timer operation is enabled (t32 = 1 ) in the timer control regist er (txcon<3>), the tsidl bit must be cleared to operate th e 32-bit timer in idle mode. 3: the tyck pin is not available on all timers. see ? pin diagrams ? section for the available pins.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 204 preliminary ? 2011 microchip technology inc. notes:
? 2011 microchip technology inc. preliminary ds70657d-page 205 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 14.0 input capture the input capture module is useful in applications requiring frequency (perio d) and pulse measurement. the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/ 50x, and pic24epxxxgp/mc 20x devices support up to 4 input capture channels. key features of the inpu t capture module include: ? hardware-configurable for 32-bit operation in all modes by cascading two adjacent modules ? synchronous and trigger modes of output compare operation, with up to 31 user-selectable trigger/sync sources available ? a 4-level fifo buffer for capturing and holding timer values for several events ? configurable interrupt generation ? up to six clock sources av ailable for each module, driving a separate internal 16-bit counter figure 14-1: input capture module block diagram note 1: this data sheet summ arizes the features of the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x families of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to section 12. ?input cap- ture? (ds70352) of the ? dspic33e/ pic24e family reference manual ?, which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for de vice-specific register and bit information. icxbuf 4-level fifo buffer icx pin icm<2:0> set icxif edge detect logic ici<1:0> icov, icbne interrupt logic system bus prescaler counter 1:1/4/16 and clock synchronizer event and trigger and sync logic clock select ic clock sources trigger and sync sources ictsel<2:0> syncsel<4:0> trigger (1) 16 16 16 icxtmr increment reset note 1: the trigger/sync source is enabled by default and is set to timer3 as a source. this timer must be enabled for proper icx module operation or the trigger/sync source must be changed to another source option. ptg trigger input ctmu edge-control logic
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 206 preliminary ? 2011 microchip technology inc. 14.1 input capture resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 14.1.1 key resources ? section 12. ?input capture? (ds70352) ? code samples ? application notes ? software libraries ? webinars ? all related dspic33e/pic24e family reference manuals sections ? development tools note: in the event you are not able to access the product page using t he link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
? 2011 microchip technology inc. preliminary ds70657d-page 207 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 14.2 input capture registers register 14-1: icxcon1: input capture x control register 1 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 u-0 u-0 ? ? icsidl ictsel<2:0> ? ? bit 15 bit 8 u-0 r/w-0 r/w-0 r/hc/hs-0 r/hc/hs-0 r/w-0 r/w-0 r/w-0 ? ici<1:0> icov icbne icm<2:0> bit 7 bit 0 legend: r = readable bit hc = cleared by hardware hs = set by hardware ?0? = bit is cleared -n = value at por w = writable bit u = unimplemented bit, read as ?0? bit 15-14 unimplemented: read as ? 0 ? bit 13 icsidl: input capture stop in idle control bit 1 = input capture will halt in cpu idle mode 0 = input capture will continue to operate in cpu idle mode bit 12-10 ictsel<12:10>: input capture timer select bits 111 = peripheral clock (f p ) is the clock source of the icx 110 = reserved 101 = reserved 100 = t1clk is the clock source of the icx (only the synchronous clock is supported) 011 = t5clk is the clock source of the icx 010 = t4clk is the clock source of the icx 001 = t2clk is the clock source of the icx 000 = t3clk is the clock source of the icx bit 9-7 unimplemented: read as ? 0 ? bit 6-5 ici<1:0>: number of captures per interrupt select bits (this field is not used if icm<2:0> = 001 or 111 ) 11 = interrupt on every fourth capture event 10 = interrupt on every third capture event 01 = interrupt on every second capture event 00 = interrupt on every capture event bit 4 icov: input capture overflow status flag bit (read-only) 1 = input capture buffer overflow occurred 0 = no input capture buffer overflow occurred bit 3 icbne: input capture buffer not empty status bit (read-only) 1 = input capture buffer is not empty, at least one more capture value can be read 0 = input capture buffer is empty bit 2-0 icm<2:0>: input capture mode select bits 111 = input capture function s as interrupt pin only in cpu sleep and idle mode (rising edge detect only, all other control bits are not applicable) 110 = unused (module disabled) 101 = capture mode, every 16th rising edge (prescaler capture mode) 100 = capture mode, every 4th rising edge (prescaler capture mode) 011 = capture mode, every rising edge (simple capture mode) 010 = capture mode, every falling edge (simple capture mode) 001 = capture mode, every edge, rising and falling (e dge detect mode (ici<1:0>) is not used in this mode) 000 = input capture module is turned off
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 208 preliminary ? 2011 microchip technology inc. register 14-2: icxcon2: input capture x control register 2 u-0 u-0 u-0 u-0 u-0 u-0 u-0 r/w-0 ? ? ? ? ? ? ?ic32 bit 15 bit 8 r/w-0 r/w/hs-0 u-0 r/w-0 r/w-1 r/w-1 r/w-0 r/w-1 ictrig (2) trigstat (3) ? syncsel<4:0> bit 7 bit 0 legend: r = readable bit hs = set by hardware ?0? = bit is cleared -n = value at por w = writable bit u = unimplemented bit, read as ?0? bit 15-9 unimplemented: read as ? 0 ? bit 8 ic32: 32-bit timer mode select bit (cascade mode) 1 = odd ic and even ic form a single 32-bit input capture module (1) 0 = cascade module operation disabled bit 7 ictrig: trigger operation select bit (2) 1 = input source used to trigger t he input capture timer (trigger mode) 0 = input source used to synchronize input capture timer to timer of another module (synchronization mode) bit 6 trigstat: timer trigger status bit (3) 1 = icxtmr has been triggered and is running 0 = icxtmr has not been triggered and is being held clear bit 5 unimplemented: read as ? 0 ? note 1: the ic32 bit in both the odd and even ic must be set to enable cascade mode. 2: the input source is selected by the syncsel<4:0> bits of the icxcon2 register. 3: this bit is set by the selected input source (selec ted by syncsel<4:0> bits). it can be read, set, and cleared in software. 4: do not use the icx module as its own sync or trigger source. 5: this option should only be selected as trigge r source and not as a synchronization source. 6: each input capture module (icx) has one ptg input source. see section 24.0 ?peripheral trigger generator (p tg) module? for more information. ptgo8 = ic1 ptgo9 = ic2 ptgo10 = ic3 ptgo11 = ic4
? 2011 microchip technology inc. preliminary ds70657d-page 209 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x bit 4-0 syncsel<4:0>: input source select for synchron ization and trigger operation bits (4) 11111 = no sync or trigger source for icx 11110 = reserved 11101 = reserved 11100 = ctmu module synchronizes or triggers icx 11011 = adc1 module synchronizes or triggers icx (5) 11010 = cmp3 module synchronizes or triggers icx (5) 11001 = cmp2 module synchronizes or triggers icx (5) 11000 = cmp1 module synchronizes or triggers icx (5) 10111 = reserved 10110 = reserved 10101 = reserved 10100 = reserved 10011 = ic4 module synchronizes or triggers icx 10010 = ic3 module synchronizes or triggers icx 10001 = ic2 module synchronizes or triggers icx 10000 = ic1 module synchronizes or triggers icx 01111 = timer5 synchronizes or triggers icx 01110 = timer4 synchronizes or triggers icx 01101 = timer3 synchronizes or triggers icx (default) 01100 = timer2 synchronizes or triggers icx 01011 = timer1 synchronizes or triggers icx 01010 = ptgox module synchroni zes or triggers icx (6) 01001 = reserved 01000 = reserved 00111 = reserved 00110 = reserved 00101 = reserved 00100 = oc4 module synchronizes or triggers icx 00011 = oc3 module synchronizes or triggers icx 00010 = oc2 module synchronizes or triggers icx 00001 = oc1 module synchronizes or triggers icx 00000 = no sync or trigger source for icx register 14-2: icxcon2: input capture x control register 2 (continued) note 1: the ic32 bit in both the odd and even ic must be set to enable cascade mode. 2: the input source is selected by the syncsel<4:0> bits of the icxcon2 register. 3: this bit is set by the selected in put source (selected by syncsel<4:0 > bits). it can be read, set, and cleared in software. 4: do not use the icx module as its own sync or trigger source. 5: this option should only be selected as tri gger source and not as a synchronization source. 6: each input capture module (icx ) has one ptg input source. see section 24.0 ?peripheral trigger generator (p tg) module? for more information. ptgo8 = ic1 ptgo9 = ic2 ptgo10 = ic3 ptgo11 = ic4
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 210 preliminary ? 2011 microchip technology inc. notes:
? 2011 microchip technology inc. preliminary ds70657d-page 211 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 15.0 output compare the output compare module can select one of eight available clock sources for its time base. the module compares the value of the timer with the value of one or two compare registers depending on the operating mode selected. the state of the output pin changes when the timer value matches the compare register value. the output compare module generates either a single output pulse or a sequence of output pulses, by changing the state of the output pin on the compare match events. the output compare module can also generate interrupts on compare match events and trigger dma data transfers. figure 15-1: output compare module block diagram note 1: this data sheet summ arizes the features of the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x families of devices. it is not intended to be a compre- hensive reference source. to comple- ment the information in this data sheet, refer to section 13. ?output compare? (ds70358) of the ? dspic33e/pic24e family reference manual ?, which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for de vice-specific register and bit information. note: see section 13. ?output compare? (ds70358) in the ?dspic33e/pic24e family reference manual? for ocxr and ocxrs register restrictions. ocxr buffer comparator ocxtmr ocxcon1 ocxcon2 oc output and ocx interrupt ocx pin ocxrs buffer comparator fault logic match match trigger and sync logic clock select increment reset oc clock sources trigger and sync sources reset match event ocfa ocxr ocxrs event event rollover rollover/reset rollover/reset ocx synchronization/trigger event ocfb syncsel<4:0> trigger (1) note 1: the trigger/sync source is enabled by default and is set to timer2 as a source. this timer must be enabled for proper ocx module operation or the trigger/sync source must be changed to another source option. ptg trigger input ctmu edge-control logic
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 212 preliminary ? 2011 microchip technology inc. 15.1 output compare resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 15.1.1 key resources ? section 13. ?output compare? (ds70358) ? code samples ? application notes ? software libraries ? webinars ? all related dspic33e/pic24e family reference manuals sections ? development tools note: in the event you are not able to access the product page using t he link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
? 2011 microchip technology inc. preliminary ds70657d-page 213 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 15.2 output compare control registers register 15-1: ocxcon1: output comparex control register 1 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 u-0 r/w-0 ? ? ocsidl octsel<2:0> ?enfltb bit 15 bit 8 r/w-0 u-0 r/w-0 hcs r/w-0 hcs r/w-0 r/w-0 r/w-0 r/w-0 enflta ? ocfltb ocflta trigmode ocm<2:0> bit 7 bit 0 legend: hcs = hardware clearable/settable bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13 ocsidl: stop output compare x in idle mode control bit 1 = output compare x halts in cpu idle mode 0 = output compare x continues to operate in cpu idle mode bit 12-10 octsel<2:0>: output compare x clock select bits 111 = peripheral clock (f p ) 110 = reserved 101 = ptgox clock (2) 100 = t1clk is the clock source of the ocx (only the synchronous clock is supported) 011 = t5clk is the clock source of the ocx 010 = t4clk is the clock source of the ocx 001 = t3clk is the clock source of the ocx 000 = t2clk is the clock source of the ocx bit 9 unimplemented: read as ? 0 ? bit 8 enfltb: fault b input enable bit 1 = output compare fault b input (ocfb) is enabled 0 = output compare fault b input (ocfb) is disabled bit 7 enflta: fault a input enable bit 1 = output compare fault a input (ocfa) is enabled 0 = output compare fault a input (ocfa) is disabled bit 6 unimplemented: read as ? 0 ? bit 5 ocfltb: pwm fault b condition status bit 1 = pwm fault b condition on ocfb pin has occurred 0 = no pwm fault b condition on ocfb pin has occurred bit 4 ocflta: pwm fault a condition status bit 1 = pwm fault a condition on ocfa pin has occurred 0 = no pwm fault a condition on ocfa pin has occurred bit 3 trigmode: trigger status mode select bit 1 = trigstat (ocxcon2<6>) is cleared when ocxrs = ocxtmr or in software 0 = trigstat is cleared only by software note 1: ocxr and ocxrs are double-buffered in pwm mode only. 2: each output compare module (ocx) has one ptg clock source. see section 24.0 ?peripheral trigger generator (p tg) module? for more information. ptgo4 = oc1 ptgo5 = oc2 ptgo6 = oc3 ptgo7 = oc4
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 214 preliminary ? 2011 microchip technology inc. bit 2-0 ocm<2:0>: output compare mode select bits 111 = center-aligned pwm mode: output set high when ocxtmr = ocxr and set low when ocxtmr = ocxrs (1) 110 = edge-aligned pwm mode: output set high when ocxtmr = 0 and set low when ocxtmr = ocxr (1) 101 = double compare continuous pulse mode: init ialize ocx pin low, toggle ocx state continuously on alternate matches of ocxr and ocxrs 100 = double compare single-shot mode: initialize ocx pin low, toggle ocx state on matches of ocxr and ocxrs for one cycle 011 = single compare mode: compare events with ocxr, continuously toggle ocx pin 010 = single compare single-shot mode: initialize ocx pin high, compare event with ocxr, forces ocx pin low 001 = single compare single-shot mode: initialize oc x pin low, compare event with ocxr, forces ocx pin high 000 = output compare channel is disabled register 15-1: ocxcon1: output comparex control register 1 (continued) note 1: ocxr and ocxrs are double-buffered in pwm mode only. 2: each output compare module (ocx) has one ptg clock source. see section 24.0 ?peripheral trigger generator (p tg) module? for more information. ptgo4 = oc1 ptgo5 = oc2 ptgo6 = oc3 ptgo7 = oc4
? 2011 microchip technology inc. preliminary ds70657d-page 215 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 15-2: ocxcon2: output compare x control register 2 r/w-0 r/w-0 r/w-0 r/w-0 u-0 u-0 u-0 r/w-0 fltmd fltout flttrien ocinv ? ? ? oc32 bit 15 bit 8 r/w-0 r/w-0 hs r/w-0 r/w-0 r/w-1 r/w-1 r/w-0 r/w-0 octrig trigstat octris syncsel<4:0> bit 7 bit 0 legend: hs = hardware settable bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 fltmd: fault mode select bit 1 = fault mode is maintained until the fault source is removed; the corresponding ocfltx bit is cleared in software and a new pwm period starts 0 = fault mode is maintained until the fault source is removed and a new pwm period starts bit 14 fltout: fault out bit 1 = pwm output is driven high on a fault 0 = pwm output is driven low on a fault bit 13 flttrien: fault output state select bit 1 = ocx pin is tri-stated on fault condition 0 = ocx pin i/o state defined by fltout bit on fault condition bit 12 ocinv: ocmp invert bit 1 = ocx output is inverted 0 = ocx output is not inverted bit 11-9 unimplemented: read as ? 0 ? bit 8 oc32: cascade two ocx modules enable bit (32-bit operation) 1 = cascade module operation enabled 0 = cascade module operation disabled bit 7 octrig: ocx trigger/sync select bit 1 = trigger ocx from source designated by syncselx bits 0 = synchronize ocx with source designated by syncselx bits bit 6 trigstat: timer trigger status bit 1 = timer source has been triggered and is running 0 = timer source has not been triggered and is being held clear bit 5 octris: ocx output pin direction select bit 1 = ocx is tri-stated 0 = output compare module drives the ocx pin note 1: do not use the ocx module as its own synchronization or trigger source. 2: when the ocy module is turned off, it sends a trigger out signal. if the ocx module use the ocy module as a trigger source, the ocy module must be unsele cted as a trigger source prior to disabling it. 3: each output compare module (ocx) has one ptg trigger/synchronization source. see section 24.0 ?peripheral trigger generator (ptg) module? for more information. ptgo0 = oc1 ptgo1 = oc2 ptgo2 = oc3 ptgo3 = oc4
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 216 preliminary ? 2011 microchip technology inc. bit 4-0 syncsel<4:0>: trigger/synchronization source selection bits 11111 = no sync or trigger source for ocx 11110 = int2 pin synchronizes or triggers ocx 11101 = int1 pin synchronizes or triggers ocx 11100 = ctmu module synchronizes or triggers ocx 11011 = adc1 module synchronizes or triggers ocx 11010 = cmp3 module synchronizes or triggers ocx 11001 = cmp2 module synchronizes or triggers ocx 11000 = cmp1 module synchronizes or triggers ocx 10111 = reserved 10110 = reserved 10101 = reserved 10100 = reserved 10011 = ic4 module synchronizes or triggers ocx 10010 = ic3 module synchronizes or triggers ocx 10001 = ic2 module synchronizes or triggers ocx 10000 = ic1 module synchronizes or triggers ocx 01111 = timer5 synchronizes or triggers ocx 01110 = timer4 synchronizes or triggers ocx 01101 = timer3 synchronizes or triggers ocx 01100 = timer2 synchronizes or triggers ocx (default) 01011 = timer1 synchronizes or triggers ocx 01010 = ptgox synchronizes or trigger ocx (3) 01001 = reserved 01000 = reserved 00111 = reserved 00110 = reserved 00101 = reserved 00100 = oc4 module synchronizes or triggers ocx (1,2) 00011 = oc3 module synchronizes or triggers ocx (1,2) 00010 = oc2 module synchronizes or triggers ocx (1,2) 00001 = oc1 module synchronizes or triggers ocx (1,2) 00000 = no sync or trigger source for ocx register 15-2: ocxcon2: output compar e x control register 2 (continued) note 1: do not use the ocx module as its own synchronization or trigger source. 2: when the ocy module is turned off, it sends a trigger out signal. if the ocx module use the ocy module as a trigger source, the ocy module must be unsele cted as a trigger source prior to disabling it. 3: each output compare module (ocx) has one ptg trigger/synchronization source. see section 24.0 ?peripheral trigger generator (ptg) module? for more information. ptgo0 = oc1 ptgo1 = oc2 ptgo2 = oc3 ptgo3 = oc4
? 2011 microchip technology inc. preliminary ds70657d-page 217 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 16.0 high-speed pwm module (dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only) the dspic33epxxxmc20x/50x and pic24epxxxmc20x devices support a dedicated pulse-width modulation (pwm) module with up to 6 outputs. the high-speed pwm module consists of the following major features: ? three pwm generators ? two pwm outputs per pwm generator ? individual peri od and duty cycle for each pwm pair ? duty cycle, dead time, phase shift and frequency resolution of 8.32 ns ? independent fault and current-limit inputs for six pwm outputs ? redundant output ? center-aligned pwm mode ? output override control ? chop mode (also known as gated mode) ? special event trigger ? prescaler for input clock ? pwmxl and pwmxh output pin swapping ? independent pwm frequency, duty cycle and phase shift changes for each pwm generator ? dead-time compensation ? enhanced leading-edge blanking (leb) functionality ? frequency resolution enhancement ? pwm capture functionality the high-speed pwm module contains up to three pwm generators. each pwm generator provides two pwm outputs: pwmxh and pwmxl . the master time base generator provides a synchronous signal as a common time base to synchronize the various pwm outputs. the individual pwm outputs are available on the output pins of the device. the input fault signals and current-limit signals, when enabled, can monitor and protect the system by placing the pwm outputs into a known ?safe? state. each pwm can generate a trigger to the adc module to sample the analog signal at a specific instance dur- ing the pwm period. in addition, the high-speed pwm module also generates a special event trigger to the adc module based on either of the two master time bases. the high-speed pwm module can synchronize itself with an external signal or can act as a synchronizing source to any external device. the synci1 input pin that utilizes pps, can syn chronize the high-speed pwm module with an external signal. the synco1 pin is an output pin that provides a synchronous signal to an external device. figure 16-1 illustrates an architectural overview of the high-speed pwm module and its interconnection with the cpu and other peripherals. 16.1 pwm faults the pwm module incorporates multiple external fault inputs to include flt1 and flt2 , which are re- mappable using the pps feature, flt3 and flt4 , which are available only on the larger 44-pin and 64-pin packages, and flt32 , which has been implemented with class b safety features, and is available on a fixed pin on all dspic3 3epxxxmc20x/50x and pic24epxxxmc20x devices. these faults provide a safe and reliable way to safely shut down the pwm outputs when the fault input is asserted. 16.1.1 pwm faults at reset during any reset event, the pwm module maintains ownership of the class b fault f lt32 . at reset, this fault is enabled in latched mode to guarantee the fail-safe power-up of the application. the application software must clear the pwm fault before enabling the high- speed motor control pwm mo dule. to clear the fault condition, the flt32 pin must first be pulled high externally or the internal pull up resistor in the cnpux register can be enabled. note 1: this data sheet summ arizes the features of the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x families of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to section 14. ?high-speed pwm? (ds70645) of the ? dspic33e/ pic24e family reference manual ?, which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for de vice-specific register and bit information. note: in edge-aligned pwm mode, the duty cycle, dead-time, phase shift and frequency resolution are 8.32 ns. note: the fault mode may be changed using the fltmod<1:0> bits (fclcon<1:0>) regardless of the state of flt32 .
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 218 preliminary ? 2011 microchip technology inc. 16.1.2 write-protected registers on dspic33epxxxmc20x/50x and pic24epxxxmc20x devices, write protection is implemented for the ioconx and fclconx registers. the write protection featur e prevents any inadvertent writes to these registers. this protection feature can be controlled by the pwml ock configuration bit (foscsel<6>). the defaul t state of the write protection feature is enabled (pwmlock = 1 ). the write protection feature can be disabled by configuring pwmlock = 0 . to gain write access to thes e locked registers, the user application must write two consecutive values of (0xabcd and 0x4321) to the pwmkey register to perform the unlock operation. the write access to the ioconx or fclconx registers must be the next sfr access following the unlock process. there can be no other sfr accesses during the unlock process and subsequent write access. to write to both the ioconx and fclconx registers requires two unlock operations. the correct unlocking sequence is described in example 16-1 . example 16-1: pwm write-protec ted register unlock sequence ; flt32 pin must be pulled high externally in order to clear and disable the fault ; writing to fclcon1 register requires unlock sequence mov #0xabcd,w10 ; load first unlock key to w10 register mov #0x4321,w11 ; load second unlock key to w11 register mov #0x0000,w0 ; load desired value of fclcon1 register in w0 mov w10, pwmkey ; write first unlock key to pwmkey register mov w11, pwmkey ; write second unlock key to pwmkey register mov w0,fclcon1 ; write desired value to fclcon1 register ; set pwm ownership and polarity using the iocon1 register ; writing to iocon1 register requires unlock sequence mov #0xabcd,w10 ; load first unlock key to w10 register mov #0x4321,w11 ; load second unlock key to w11 register mov #0xf000,w0 ; load desired value of iocon1 register in w0 mov w10, pwmkey ; write first unlock key to pwmkey register mov w11, pwmkey ; write second unlock key to pwmkey register mov w0,iocon1 ; write desired value to iocon1 register
? 2011 microchip technology inc. preliminary ds70657d-page 219 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x figure 16-1: high-speed pwm module architectural overview cpu pwm generator 1 pwm generator 2 pwm generator 3 synci1 synco1 pwm1h pwm1l pwm1 interrupt pwm2h pwm2l pwm2 interrupt pwm3h pwm3l pwm3 interrupt synchronization signal data bus adc module flt1 -flt 4 , flt32 synchronization signal synchronization signal primary trigger primary special dtcmp1-dtcmp3 fault, current-limit and dead-time compensation event trigger master time base fault, current-limit and dead-time compensation fault, current-limit and dead-time compensation f osc
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 220 preliminary ? 2011 microchip technology inc. figure 16-2: high-speed pwm module register interconnection diagram mux ptmrx pdcx pwmconx, ptcon, ptcon2 ioconx dtrx pwmxl pwmxh flt x pwm1l pwm1h fclconx mdc phasex lebconx, altdtrx user override logic current-limit pwm output mode control logic dead logic pin control logic fault and current-limit logic pwm generator 1 fltx pwm generator 2 and pwm generator 3 interrupt logic module control and timing master duty cycle register synchronization synchronization master period master period master duty cycle master duty cycle synci1 synco1 sevtcmp comparator special event trigger special event postscaler ptper pmtmr primary master time base master time base counter special event compare trigger comparator clock prescaler comparator 16-bit data bus time fault override logic override logic dtcmpx dtcmp1 f osc pwmkey ioconx and fclconx unlock register auxconx lebdlyx ptg trigger input ptg trigger input ptg trigger input trgconx pwmcapx adc trigger comparator trigx
? 2011 microchip technology inc. preliminary ds70657d-page 221 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 16.2 pwm resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 16.2.1 key resources ? section 14. ?high-speed pwm? (ds70645) ? code samples ? application notes ? software libraries ? webinars ? all related dspic33e/pic24e family reference manuals sections ? development tools note: in the event you are not able to access the product page using t he link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 222 preliminary ? 2011 microchip technology inc. 16.3 pwm control registers register 16-1: ptcon: pwm time base control register r/w-0 u-0 r/w-0 hs/hc-0 r/w-0 r/w-0 r/w-0 r/w-0 pten ? ptsidl sestat seien eipu (1) syncpol (1) syncoen (1) bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 syncen (1) syncsrc<2:0> (1) sevtps<3:0> (1) bit 7 bit 0 legend: hc = cleared in hardware hs = set in hardware r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 pten: pwm module enable bit 1 = pwm module is enabled 0 = pwm module is disabled bit 14 unimplemented: read as ? 0 ? bit 13 ptsidl: pwm time base stop in idle mode bit 1 = pwm time base halts in cpu idle mode 0 = pwm time base runs in cpu idle mode bit 12 sestat: special event interrupt status bit 1 = special event interrupt is pending 0 = special event interrupt is not pending bit 11 seien: special event interrupt enable bit 1 = special event interrupt is enabled 0 = special event interrupt is disabled bit 10 eipu: enable immediate period updates bit (1) 1 = active period register is updated immediately 0 = active period register updat es occur on pwm cycle boundaries bit 9 syncpol: synchronize input and output polarity bit (1) 1 = synci1/synco1 polarity is inverted (active-low) 0 = synci1/synco1 is active-high bit 8 syncoen: primary time base sync enable bit (1) 1 = synco1 output is enabled 0 = synco1 output is disabled bit 7 syncen: external time base synchronization enable bit (1) 1 = external synchronization of primary time base is enabled 0 = external synchronization of primary time base is disabled bit 6-4 syncsrc<2:0>: synchronous source selection bits (1) 111 = reserved ? ? ? 100 = reserved 011 = ptgo17 (2) 010 = ptgo16 (2) 001 = reserved 000 = synci 1 input from pps note 1: these bits should be changed only when pten = 0 . in addition, when using th e synci1 feature, the user application must program the period regi ster with a value that is slightly larger than the expected period of the external synchronization input signal. 2: see section 24.0 ?peripheral trigger generator (ptg) module? for information on this selection.
? 2011 microchip technology inc. preliminary ds70657d-page 223 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x bit 3-0 sevtps<3:0>: pwm special event trigger ou tput postscaler select bits (1) 1111 = 1:16 postscaler generates special event trigger on every sixteenth compare match event ? ? ? 0001 = 1:2 postscaler generates special event tr igger on every second compare match event 0000 = 1:1 postscaler generates special event trigger on every compare match event register 16-1: ptcon: pwm time base control register (continued) note 1: these bits should be changed only when pten = 0 . in addition, when using th e synci1 feature, the user application must program the period regi ster with a value that is slightly larger than the expected period of the external synchronization input signal. 2: see section 24.0 ?peripheral trigger generator (ptg) module? for information on this selection.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 224 preliminary ? 2011 microchip technology inc. register 16-2: ptcon2: pwm primary master clock divider select register u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 ? ? ? ? ? pclkdiv<2:0> (1) bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-3 unimplemented: read as ? 0 ? bit 2-0 pclkdiv<2:0>: pwm input clock prescale r (divider) select bits (1) 111 = reserved 110 = divide by 64 101 = divide by 32 100 = divide by 16 011 = divide by 8 010 = divide by 4 001 = divide by 2 000 = divide by 1, maximum pwm timi ng resolution (power-on default) note 1: these bits should be changed only when pten = 0 . changing the clock selection during operation will yield unpredictable results.
? 2011 microchip technology inc. preliminary ds70657d-page 225 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 16-3: ptper: primary ma ster time base period register r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 ptper<15:8> bit 15 bit 8 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-0 r/w-0 r/w-0 ptper<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 ptper<15:0>: primary master time base (pmtmr) period value bits register 16-4: sevtcmp: pwm primary special event compare register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 sevtcmp<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 sevtcmp<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 sevtcmp<15:0>: special event compare count value bits
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 226 preliminary ? 2011 microchip technology inc. register 16-5: chop: pwm chop clock generator register r/w-0 u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 chpclken ? ? ? ? ? chop<9:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 chop<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 chpclken: enable chop clock generator bit 1 = chop clock generator is enabled 0 = chop clock generator is disabled bit 14-10 unimplemented: read as ? 0 ? bit 9-0 chop<9:0>: chop clock divider bits the frequency of the chop clock signal is given by the following expression: chop frequency = (f p /pclkdiv<2:0)/(chop<9:0> + 1) register 16-6: mdc: pwm master duty cycle register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 mdc<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 mdc<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 mdc<15:0>: master pwm duty cycle value bits
? 2011 microchip technology inc. preliminary ds70657d-page 227 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 16-7: pwmconx : pwm control register hs/hc-0 hs/hc-0 hs/hc-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 fltstat (1) clstat (1) trgstat fltien clien trgien itb (2) mdcs (2) bit 15 bit 8 r/w-0 r/w-0 r/w-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 dtc<1:0> dtcp (3) ?mtbscam (2,4) xpres (5) iue (2) bit 7 bit 0 legend: hc = cleared in hardware hs = set in hardware r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 fltstat: fault interrupt status bit (1) 1 = fault interrupt is pending 0 = no fault interrupt is pending this bit is cleared by setting fltien = 0 . bit 14 clstat: current-limit interrupt status bit (1) 1 = current-limit in terrupt is pending 0 = no current-limit interrupt is pending this bit is cleared by setting clien = 0 . bit 13 trgstat: trigger interrupt status bit 1 = trigger interrupt is pending 0 = no trigger interrupt is pending this bit is cleared by setting trgien = 0 . bit 12 fltien: fault interrupt enable bit 1 = fault interrupt is enabled 0 = fault interrupt is disabled and fltstat bit is cleared bit 11 clien: current-limit interrupt enable bit 1 = current-limit interrupt enabled 0 = current-limit interrupt disabled and clstat bit is cleared bit 10 trgien: trigger interrupt enable bit 1 = a trigger event generates an interrupt request 0 = trigger event interrupts are disabled and trgstat bit is cleared bit 9 itb: independent time base mode bit (2) 1 = phasex register provides time base period for this pwm generator 0 = ptper register provides timing for this pwm generator bit 8 mdcs: master duty cycle register select bit (2) 1 = mdc register provides duty cycle information for this pwm generator 0 = pdcx register provides duty cycl e information for th is pwm generator note 1: software must clear the interrupt status here and in the corresponding ifs bit in the interrupt controller. 2: these bits should not be changed after the pwm is enabled (pten = 1 ). 3: dtc<1:0> = 11 for dtcp to be effective; otherwise, dtcp is ignored. 4: the independent time base (itb = 1 ) mode must be enabled to use center-aligned mode. if itb = 0 , the cam bit is ignored. 5: to operate in external period reset mode, the itb bit must be ? 1 ? and the clmod bit in the fclconx register must be ? 0 ?.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 228 preliminary ? 2011 microchip technology inc. bit 7-6 dtc<1:0>: dead-time control bits 11 = dead-time compensation mode 10 = dead-time function is disabled 01 = negative dead time actively applied for complementary output mode 00 = positive dead time actively applied for all output modes bit 5 dtcp: dead-time compensation polarity bit (3) when set to ? 1 ?: if dtcmpx = 0 , pwmlx is shortened and pwmhx is lengthened. if dtcmpx = 1 , pwmhx is shortened and pwmlx is lengthened. when set to ? 0 ?: if dtcmpx = 0 , pwmhx is shortened and pwmlx is lengthened. if dtcmpx = 1 , pwmlx is shortened and pwmhx is lengthened. bit 4 unimplemented: read as ? 0 ? bit 3 mtbs: master time base select bit 1 = pwm generator uses the secondary master time base for synchronization and as the clock source for the pwm generation logic (if secondary time base is available) 0 = pwm generator uses the primar y master time base for synchroni zation and as the clock source for the pwm generation logic bit 2 cam: center-aligned mode enable bit (2,4) 1 = center-aligned mode is enabled 0 = edge-aligned mode is enabled bit 1 xpres: external pwm reset control bit (5) 1 = current-limit source resets the time base for th is pwm generator if it is in independent time base mode 0 = external pins do not affect pwm time base bit 0 iue: immediate update enable bit 1 = updates to the active mdc/pdcx/dtx/altdtrx/phasex registers are immediate 0 = updates to the active mdc/pdcx/dtx/altdt rx/phasex registers ar e synchronized to the pwm time base register 16-7: pwmconx: pwm co ntrol register (continued) note 1: software must clear the interrupt status here and in the corresponding ifs bit in the interrupt controller. 2: these bits should not be changed after the pwm is enabled (pten = 1 ). 3: dtc<1:0> = 11 for dtcp to be effective; otherwise, dtcp is ignored. 4: the independent time base (itb = 1 ) mode must be enabled to use center-aligned mode. if itb = 0 , the cam bit is ignored. 5: to operate in external period reset mode, the itb bit must be ? 1 ? and the clmod bit in the fclconx register must be ? 0 ?.
? 2011 microchip technology inc. preliminary ds70657d-page 229 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 16-8: pdcx: pwm generator duty cycle register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 pdcx<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 pdcx<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 pdcx<15:0>: pwm generator # duty cycle value bits register 16-9: phasex: pwm pr imary phase shift register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 phasex<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 phasex<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 phasex<15:0>: pwm phase shift value or independent time base period bits for the pwm generator note 1: if itb (pwmconx<9>) = 0 , the following applies based on the mode of operation: complementary, redundant and push-pull ou tput mode (pmod<1:0> (iocon<11:10>) = 00 , 01 or 10 ), phasex<15:0> = phase shift val ue for pwmxh and pwmxl outputs 2: if itb (pwmconx<9>) = 1 , the following applies based on the mode of operation: complementary, redundant and push-pull ou tput mode (pmod<1:0> (ioconx<11:10>) = 00 , 01 or 10 ), phasex<15:0> = independent time base period value for pwmxh and pwmxl
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 230 preliminary ? 2011 microchip technology inc. register 16-10: dtrx: pwm dead-time register u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? dtrx<13:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 dtrx<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13-0 dtrx<13:0>: unsigned 14-bit dead-time value bits for pwmx dead-time unit register 16-11: altdtrx: pwm alternate dead-time register u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? altdtrx<13:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 altdtrx<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13-0 altdtrx<13:0>: unsigned 14-bit dead-time value bits for pwmx dead-time unit
? 2011 microchip technology inc. preliminary ds70657d-page 231 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 16-12: trgconx: pw m trigger control register r/w-0 r/w-0 r/w-0 r/w-0 u-0 u-0 u-0 u-0 trgdiv<3:0> ? ? ? ? bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ?trgstrt<5:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-12 trgdiv<3:0>: trigger # output divider bits 1111 = trigger output for every 16th trigger event 1110 = trigger output for every 15th trigger event 1101 = trigger output for every 14th trigger event 1100 = trigger output for every 13th trigger event 1011 = trigger output for every 12th trigger event 1010 = trigger output for every 11th trigger event 1001 = trigger output for every 10th trigger event 1000 = trigger output for every 9th trigger event 0111 = trigger output for every 8th trigger event 0110 = trigger output for every 7th trigger event 0101 = trigger output for every 6th trigger event 0100 = trigger output for every 5th trigger event 0011 = trigger output for every 4th trigger event 0010 = trigger output for every 3rd trigger event 0001 = trigger output for every 2nd trigger event 0000 = trigger output for every trigger event bit 11-6 unimplemented: read as ? 0 ? bit 5-0 trgstrt<5:0>: trigger postscaler start enable select bits 111111 = wait 63 pwm cycles before generating the first trigger event after the module is enabled ? ? ? 000010 = wait 2 pwm cycles before generating the fi rst trigger event after the module is enabled 000001 = wait 1 pwm cycles before generating the fi rst trigger event after the module is enabled 000000 = wait 0 pwm cycles before generating the fi rst trigger event after the module is enabled note 1: the secondary pwm generator cannot generate pwm trigger interrupts.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 232 preliminary ? 2011 microchip technology inc. register 16-13: ioconx: pwm i/o control register (2) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 penh penl polh poll pmod<1:0> (1) ovrenh ovrenl bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ovrdat<1:0> fltdat<1:0> cldat<1:0> swap osync bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 penh: pwmxh output pin ownership bit 1 = pwm module controls pwmxh pin 0 = gpio module controls pwmxh pin bit 14 penl: pwmxl output pin ownership bit 1 = pwm module controls pwmxl pin 0 = gpio module controls pwmxl pin bit 13 polh: pwmxh output pin polarity bit 1 = pwmxh pin is active-low 0 = pwmxh pin is active-high bit 12 poll: pwmxl output pin polarity bit 1 = pwmxl pin is active-low 0 = pwmxl pin is active-high bit 11-10 pmod<1:0>: pwm # i/o pin mode bits (1) 11 = reserved; do not use 10 = pwm i/o pin pair is in the push-pull output mode 01 = pwm i/o pin pair is in the redundant output mode 00 = pwm i/o pin pair is in the complementary output mode bit 9 ovrenh: override enable for pwmxh pin bit 1 = ovrdat<1> controls output on pwmxh pin 0 = pwm generator controls pwmxh pin bit 8 ovrenl: override enable for pwmxl pin bit 1 = ovrdat<0> controls output on pwmxl pin 0 = pwm generator controls pwmxl pin bit 7-6 ovrdat<1:0>: data for pwmxh, pwmxl pins if override is enabled bits if overenh = 1 , pwmxh is driven to the st ate specified by ovrdat<1>. if overenl = 1 , pwmxl is driven to the state specified by ovrdat<0>. bit 5-4 fltdat<1:0>: data for pwmxh and pwmxl pins if fltmod is enabled bits if fault is active, pwmxh is driven to the state specified by fltdat<1>. if fault is active, pwmxl is driven to the state specified by fltdat<0>. bit 3-2 cldat<1:0>: data for pwmxh and pwmxl pins if clmod is enabled bits if current-limit is active, pwmxh is driv en to the state specified by cldat<1>. if current-limit is active, pwmxl is driven to the state specified by cldat<0>. note 1: these bits should not be changed after the pwm module is enabled (pten = 1 ). 2: if the pwmlock configuration bit (foscsel<6>) is a ? 1 ?, the ioconx register can only be written after the unlock sequence has been executed.
? 2011 microchip technology inc. preliminary ds70657d-page 233 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x bit 1 swap: swap pwmxh and pwmxl pins bit 1 = pwmxh output signal is connected to pwmxl pins; pwmxl output signal is connected to pwmxh pins 0 = pwmxh and pwmxl pins are mapped to their respective pins bit 0 osync: output override synchronization bit 1 = output overrides via the ovrdat<1:0> bi ts are synchronized to the pwm time base 0 = output overrides via the ovddat<1:0> bits occur on the next cpu clock boundary register 16-13: ioconx: pwm i/o control register (2) (continued) note 1: these bits should not be changed after the pwm module is enabled (pten = 1 ). 2: if the pwmlock configuration bit (foscsel<6>) is a ? 1 ?, the ioconx register can only be written after the unlock sequence has been executed.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 234 preliminary ? 2011 microchip technology inc. register 16-14: trigx: pwm primar y trigger compare value register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 trgcmp<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 trgcmp<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 trgcmp<15:0>: trigger control value bits when the primary pwm functions in local time base, this register contains the compare values that can trigger the adc module.
? 2011 microchip technology inc. preliminary ds70657d-page 235 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 16-15: fclconx: pwm fau lt current-limit control register (1) u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? clsrc<4:0> clpol (2) clmod bit 15 bit 8 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-0 r/w-0 r/w-0 fltsrc<4:0> fltpol (2) fltmod<1:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14-10 clsrc<4:0>: current-limit control signal source select bits for pwm generator # these bits also specify the source for the dead-time compensation input signal, dtcmpx. 11111 = fault 32 11110 = reserved ? ? ? 01100 = reserved 01011 = comparator 4 01010 = op amp/comparator 3 01001 = op amp/comparator 2 01000 = op amp/comparator 1 00111 = reserved 00110 = reserved 00101 = reserved 00100 = reserved 00011 = fault 4 00010 = fault 3 00001 = fault 2 00000 = fault 1 (default) bit 9 clpol: current-limit polarity bit for pwm generator # (2) 1 = the selected current-limit source is active-low 0 = the selected current-limit source is active-high bit 8 clmod: current-limit mode enabl e bit for pwm generator # 1 = current-limit mode is enabled 0 = current-limit mode is disabled note 1: if the pwmlock configuration bit (foscsel<6>) is a ? 1 ?, the ioconx register can only be written after the unlock sequence has been executed. 2: these bits should be changed only when pten = 0 . changing the clock selection during operation will yield unpredictable results.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 236 preliminary ? 2011 microchip technology inc. bit 7-3 fltsrc<4:0>: fault control signal source select bits for pwm generator # 11111 = fault 32 (default) 11110 = reserved ? ? ? 01100 = reserved 01011 = comparator 4 01010 = op amp/comparator 3 01001 = op amp/comparator 2 01000 = op amp/comparator 1 00111 = reserved 00110 = reserved 00101 = reserved 00100 = reserved 00011 = fault 4 00010 = fault 3 00001 = fault 2 00000 = fault 1 bit 2 fltpol: fault polarity bit for pwm generator # (2) 1 = the selected fault source is active-low 0 = the selected fault source is active-high bit 1-0 fltmod<1:0>: fault mode bits for pwm generator # 11 = fault input is disabled 10 = reserved 01 = the selected fault source forces pwmxh, pwmxl pins to fltdat values (cycle) 00 = the selected fault source forces pwmxh, pw mxl pins to fltdat values (latched condition) register 16-15: fclconx: pwm fa ult current-limit control register (1) (continued) note 1: if the pwmlock configuration bit (foscsel<6>) is a ? 1 ?, the ioconx register can only be written after the unlock sequence has been executed. 2: these bits should be changed only when pten = 0 . changing the clock selection during operation will yield unpredictable results.
? 2011 microchip technology inc. preliminary ds70657d-page 237 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 16-16: lebconx: leading- edge blanking control register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 u-0 u-0 phr phf plr plf fltleben clleben ? ? bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? bch bcl bphh bphl bplh bpll bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 phr: pwmxh rising edge trigger enable bit 1 = rising edge of pwmxh will trigger leading-edge blanking counter 0 = leading-edge blanking ignores rising edge of pwmxh bit 14 phf: pwmxh falling edge trigger enable bit 1 = falling edge of pwmxh will trigger leading-edge blanking counter 0 = leading-edge blanking ignores falling edge of pwmxh bit 13 plr: pwmxl rising edge trigger enable bit 1 = rising edge of pwmxl will trigger leading-edge blanking counter 0 = leading-edge blanking ignores rising edge of pwmxl bit 12 plf: pwmxl falling edge trigger enable bit 1 = falling edge of pwmxl will trigger leading-edge blanking counter 0 = leading-edge blanking ignores falling edge of pwmxl bit 11 fltleben: fault input leading-edge blanking enable bit 1 = leading-edge blanking is applied to selected fault input 0 = leading-edge blanking is not applied to selected fault input bit 10 clleben: current-limit leading-edge blanking enable bit 1 = leading-edge blanking is applied to selected current-limit input 0 = leading-edge blanking is not applied to selected current-limit input bit 9-6 unimplemented: read as ? 0 ? bit 5 bch: blanking in selected blanking signal high enable bit (1) 1 = state blanking (of current-limit and/or fault in put signals) when selected blanking signal is high 0 = no blanking when selected blanking signal is high bit 4 bcl: blanking in selected blanking signal low enable bit (1) 1 = state blanking (of current-limit and/or fault in put signals) when selected blanking signal is low 0 = no blanking when selected blanking signal is low bit 3 bphh: blanking in pwmxh high enable bit 1 = state blanking (of current-limit and/or faul t input signals) when pwmxh output is high 0 = no blanking when pwmxh output is high bit 2 bphl: blanking in pwmxh low enable bit 1 = state blanking (of current-limit and/or faul t input signals) when pwmxh output is low 0 = no blanking when pwmxh output is low bit 1 bplh: blanking in pwmxl high enable bit 1 = state blanking (of current-limit and/or faul t input signals) when pwmxl output is high 0 = no blanking when pwmxl output is high bit 0 bpll: blanking in pwmxl low enable bit 1 = state blanking (of current-limit and/or faul t input signals) when pwmxl output is low 0 = no blanking when pwmxl output is low note 1: the blanking signal is sele cted via the blanksel bits in the auxconx register.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 238 preliminary ? 2011 microchip technology inc. register 16-17: lebdlyx: leading-edge blanking delay register u-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? ? ? leb<11:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 leb<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-12 unimplemented: read as ? 0 ? bit 11-0 leb<11:0>: leading-edge blanking delay bits for current-limit and fault inputs
? 2011 microchip technology inc. preliminary ds70657d-page 239 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 16-18: auxconx: pwm auxiliary control register u-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? ? ? blanksel<3:0> bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? chopsel<3:0> chophen choplen bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-12 unimplemented: read as ? 0 ? bit 11-8 blanksel<3:0>: pwm state blank source select bits the selected state blank signal will block the current- limit and/or fault input signals (if enabled via the bch and bcl bits in the lebconx register). 1001 = reserved ? ? ? 0100 = reserved 0011 = pwm3h selected as state blank source 0010 = pwm2h selected as state blank source 0001 = pwm1h selected as state blank source 0000 = no state blanking bit 7-6 unimplemented: read as ? 0 ? bit 5-2 chopsel<3:0>: pwm chop clock source select bits the selected signal will enable and disable (chop) the selected pwm outputs. 1001 = reserved ? ? ? 0100 = reserved 0011 = pwm3h selected as chop clock source 0010 = pwm2h selected as chop clock source 0001 = pwm1h selected as chop clock source 0000 = chop clock generator selected as chop clock source bit 1 chophen: pwmxh output chopping enable bit 1 = pwmxh chopping function is enabled 0 = pwmxh chopping function is disabled bit 0 choplen: pwmxl output chopping enable bit 1 = pwmxl chopping function is enabled 0 = pwmxl chopping function is disabled
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 240 preliminary ? 2011 microchip technology inc. notes:
? 2011 microchip technology inc. preliminary ds70657d-page 241 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 17.0 quadrature encoder interface (qei) module (dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only) this chapter describes the quadrature encoder inter- face (qei) module and associated operational modes. the qei module provides the interface to incremental encoders for obtaining mechanical position data. the operational features of the qei module include: ? 32-bit position counter ? 32-bit index pulse counter ? 32-bit interval timer ? 16-bit velocity counter ? 32-bit position initialization/capture/compare high register ? 32-bit position compare low register ? x4 quadrature count mode ? external up/down count mode ? external gated count mode ? external gated timer mode ? internal timer mode figure 17-1 illustrates the qei block diagram. note 1: this data sheet summ arizes the features of the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x families of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to section 15. ?quadrature encoder interface (qei)? (ds70601) of the ? dspic33e/pic24e family reference manual ?, which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for de vice-specific register and bit information.
DSPIC33EPXXXGP50X, dspic33epxxxm c20x/50x, and pi c24epxxxgp/mc20x ds70657d-page 242 preliminary ? 2011 microchip technology inc. figure 17-1: qei block diagram quadrature decoder logic cntcmpx qebx qeax indxx count dir f p count count _ en 32-bit greater than or equal compare register 32-bit index counter register digital filter homex fhomex data bus 32-bit greater than data bus count _ en cnt _ dir cnt _ dir findxx findxx pcheq 32-bit interval timer 16-bit index counter hold register 32-bit interval timer register hold register count _ en f p pchge extcnt extcnt dir _ gate 16-bit velocity count _ en cnt _ dir counter register pclle pchge divclk dir cnt _ dir dir _ gate 1?b0 pclle cntpol dir _ gate gaten 0 1 divclk or equal comparator 32-bit less than pclle or equal comparator pcleq pchge qfdiv ccm intdiv (velxcnt) (intxtmr) (intxhld) (indxxcnt) (indxxhld) indxxcntl indxxcnth posxcntl posxcnth (qei1gec) (1) 32-bit less than or equal compare register (qei1lec) 16-bit position counter hold register (posxhld) 32-bit initialization and capture register (qei1ic) (1) qcapen note 1: these registers map to the same memory location. outfnc fltren (posxcnt) 32-bit position counter register
? 2011 microchip technology inc. preliminary ds70657d-page 243 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 17.1 qei resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 17.1.1 key resources ? section 15. ?quadrature encoder interface? (ds70601) ? code samples ? application notes ? software libraries ? webinars ? all related dspic33e/pic24e family reference manuals sections ? development tools note: in the event you are not able to access the product page using t he link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 244 preliminary ? 2011 microchip technology inc. 17.2 qei control registers register 17-1: qei1con: qei control register r/w-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 qeien ? qeisidl pimod<2:0> (1) imv<1:0> (2) bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? intdiv<2:0> (3) cntpol gaten ccm<1:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 qeien: quadrature encoder interface module counter enable bit 1 = module counters are enabled 0 = module counters are disabled, but sfrs can be read or written to bit 14 unimplemented: read as ? 0 ? bit 13 qeisidl: stop in idle mode bit 1 = discontinue module operation when device enters idle mode 0 = continue module operation in idle mode bit 12-10 pimod<2:0>: position counter initialization mode select bits (1) 111 = reserved 110 = modulo count mode for position counter 101 = resets the position counter when the position counter equals qei1gec register 100 = second index event after home event initia lizes position counter wit h contents of qei1ic register 011 = first index event after home event initializes position counter with conten ts of qei1ic register 010 = next index input event initializes the posi tion counter with contents of qei1ic register 001 = every index input event resets the position counter 000 = index input event does not affect position counter bit 9-8 imv<1:0>: index match value bits (2) 11 = index match occurs when qeb = 1 and qea = 1 10 = index match occurs when qeb = 1 and qea = 0 01 = index match occurs when qeb = 0 and qea = 1 00 = index input event does not affect position counter bit 7 unimplemented: read as ? 0 ? bit 6-4 intdiv<2:0>: timer input clock prescale select bits (int erval timer, main timer (position counter), velocity counter and index counter internal clock divider select) (3) 111 = 1:256 prescale value 110 = 1:64 prescale value 101 = 1:32 prescale value 100 = 1:16 prescale value 011 = 1:8 prescale value 010 = 1:4 prescale value 001 = 1:2 prescale value 000 = 1:1 prescale value note 1: when ccm = 10 or ccm = 11 , all of the qei counters operate as timers and the pimod<2:0> bits are ignored. 2: when ccm = 00 and qea and qeb values match index match value (imv), the poscnth and poscntl registers are reset. 3: the selected clock rate should be at least twice the expected maximum quadrature count rate.
? 2011 microchip technology inc. preliminary ds70657d-page 245 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x bit 3 cntpol: position and index counter/timer direction select bit 1 = counter direction is negative unless modified by external up/down signal 0 = counter direction is positive unless modified by external up/down signal bit 2 gaten: external count gate enable bit 1 = external gate signal controls position counter operation 0 = external gate signal does not af fect position counter/timer operation bit 1-0 ccm<1:0>: counter control mode selection bits 11 = internal timer mode with optional external count is selected 10 = external clock count with optio nal external count is selected 01 = external clock count with exter nal up/down direction is selected 00 = quadrature encoder interface (x 4 mode) count mode is selected register 17-1: qei1con: qei control register (continued) note 1: when ccm = 10 or ccm = 11 , all of the qei counters operate as timers and the pimod<2:0> bits are ignored. 2: when ccm = 00 and qea and qeb values match index match value (imv), the poscnth and poscntl registers are reset. 3: the selected clock rate should be at least twice the expected maximum quadrature count rate.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 246 preliminary ? 2011 microchip technology inc. register 17-2: qei1ioc: qei i/o control register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 qcapen fltren qfdiv<2:0> outfnc<1:0> swpab bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r-x r-x r-x r-x hompol idxpol qebpol qeapol home index qeb qea bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 qcapen: position counter input capture enable bit 1 = positive edge detect of home in put triggers positio n capture function 0 = homex input event (positive edge) does not trigger a capture event bit 14 fltren: qeax/qebx/indxx/homex digit al filter enable bit 1 = input pin digital filter is enabled 0 = input pin digital filter is disabled (bypassed) bit 13-11 qfdiv<2:0>: qeax/qebx/indxx/homex digital input filter clock divide select bits 111 = 1:256 clock divide 110 = 1:64 clock divide 101 = 1:32 clock divide 100 = 1:16 clock divide 011 = 1:8 clock divide 010 = 1:4 clock divide 001 = 1:2 clock divide 000 = 1:1 clock divide bit 10-9 outfnc<1:0>: qei module output function mode select bits 11 = the ctncmpx pin goes high when qei1lec posxcnt qei1gec 10 = the ctncmpx pin goes high when posxcnt qei1lec 01 = the ctncmpx pin goes high when posxcnt qei1gec 00 = output is disabled bit 8 swpab: swap qea and qeb inputs bit 1 = qeax and qebx are swapped prior to quadrature decoder logic 0 = qeax and qebx are not swapped bit 7 hompol: homex input polarity select bit 1 = input is inverted 0 = input is not inverted bit 6 idxpol: homex input polarity select bit 1 = input is inverted 0 = input is not inverted bit 5 qebpol: qebx input pola rity select bit 1 = input is inverted 0 = input is not inverted bit 4 qeapol: qeax input polari ty select bit 1 = input is inverted 0 = input is not inverted bit 3 home: status of homex input pin after polarity control 1 = pin is at logic ? 1 ? 0 = pin is at logic ? 0 ?
? 2011 microchip technology inc. preliminary ds70657d-page 247 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x bit 2 index: status of indxx input pi n after polarity control 1 = pin is at logic ? 1 ? 0 = pin is at logic ? 0 ? bit 1 qeb: status of qebx input pin after pola rity control and swpab pin swapping 1 = pin is at logic ? 1 ? 0 = pin is at logic ? 0 ? bit 0 qea: status of qeax input pin after polarity control and swpab pin swapping 1 = pin is at logic ? 1 ? 0 = pin is at logic ? 0 ? register 17-2: qei1ioc: qei i/o control register (continued)
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 248 preliminary ? 2011 microchip technology inc. register 17-3: qei1stat: qei status register u-0 u-0 hs, rc-0 r/w-0 hs, rc-0 r/w-0 hs, rc-0 r/w-0 ? ? pcheqirq pcheqien pcleqirq pcleqien posovirq posovien bit 15 bit 8 hs, rc-0 r/w-0 hs, rc-0 r/w-0 hs, rc-0 r/w-0 hs, rc-0 r/w-0 pciirq (1) pciien velovirq velovien homirq homien idxirq idxien bit 7 bit 0 legend: hs = set by hardware c = cleared by software r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13 pcheqirq: position counter greater than or equal compare status bit 1 = posxcnt qei1gec 0 = posxcnt < qei1gec bit 12 pcheqien: position counter greater than or equal compare interrupt enable bit 1 = interrupt is enabled 0 = interrupt is disabled bit 11 pcleqirq: position counter less than or equal compare status bit 1 = posxcnt qei1lec 0 = posxcnt > qei1lec bit 10 pcleqien: position counter less than or equal compare interrupt enable bit 1 = interrupt is enabled 0 = interrupt is disabled bit 9 posovirq: position counter overflow status bit 1 = overflow has occurred 0 = no overflow has occurred bit 8 posovien: position counter overflow interrupt enable bit 1 = interrupt is enabled 0 = interrupt is disabled bit 7 pciirq: position counter (homing) initialization process complete status bit (1) 1 = posxcnt was reinitialized 0 = posxcnt was not reinitialized bit 6 pciien: position counter (homing) initialization process complete interrupt enable bit 1 = interrupt is enabled 0 = interrupt is disabled bit 5 velovirq: velocity counter overflow status bit 1 = overflow has occurred 0 = no overflow has not occurred bit 4 velovien: velocity counter overflow interrupt enable bit 1 = interrupt is enabled 0 = interrupt is disabled bit 3 homirq: status flag for home event status bit 1 = home event has occurred 0 = no home event has occurred bit 2 homien: home input event interrupt enable bit 1 = interrupt is enabled 0 = interrupt is disabled note 1: this status bit is only applicable to pimod<2:0> modes ? 011 ? and ? 100 ?.
? 2011 microchip technology inc. preliminary ds70657d-page 249 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x bit 1 idxirq: status flag for index event status bit 1 = index event has occurred 0 = no index event has occurred bit 0 idxien: index input even t interrupt enable bit 1 = interrupt is enabled 0 = interrupt is disabled register 17-3: qei1stat: qei status register (continued) note 1: this status bit is only applicable to pimod<2:0> modes ? 011 ? and ? 100 ?.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 250 preliminary ? 2011 microchip technology inc. register 17-4: posxcnth: posit ion counter high word register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 poscnt<31:24> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 poscnt<23:16> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 poscnt<31:16>: high word used to form 32-bit position counter register (posxcnt) bits register 17-5: posxcntl: positi on counter low word register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 poscnt<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 poscnt<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 poscnt<15:0>: low word used to form 32-bit position counter register (posxcnt) bits register 17-6: posxhld: posi tion counter hold register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 poshld<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 poshld<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 poshld<15:0>: hold register bits for reading and writing posxcnth
? 2011 microchip technology inc. preliminary ds70657d-page 251 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 17-7: velxcnt: velocity counter register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 velcnt<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 velcnt<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 velcnt<15:0>: velocity counter bits register 17-8: indxxcnth: index counter high word register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 indxcnt<31:24> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 indxcnt<23:16> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 indxcnt<31:16>: high word used to form 32-bit index counter register (indxxcnt) bits register 17-9: indxxcntl: ind ex counter low word register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 indxcnt<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 indxcnt<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 indxcnt<15:0>: low word used to form 32-bit i ndex counter register (indxxcnt) bits
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 252 preliminary ? 2011 microchip technology inc. register 17-10: indxxhld: i ndex counter hold register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 indxhld<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 indxhld<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 indxhld<15:0>: hold register for reading and writing indxxcnth bits register 17-11: qei1ich: initiali zation/capture high word register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 qeiic<31:24> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 qeiic<23:16> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 qeiic<31:16>: high word used to form 32-bit initializa tion/capture register (qei1ic) bits register 17-12: qei1icl: initialization/capture low word register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 qeiic<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 qeiic<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 qeiic<15:0>: low word used to form 32 -bit initialization/captur e register (qei1ic) bits
? 2011 microchip technology inc. preliminary ds70657d-page 253 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 17-13: qei1lech: less than or equal compare high word register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 qeilec<31:24> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 qeilec<23:16> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 qeilec<31:16>: high word used to form 32-bit less than or equal compare register (qei1lec) bits register 17-14: qei1lecl: less than or equal compare low word register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 qeilec<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 qeilec<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 qeilec<15:0>: low word used to form 32-bit less than or equal compare register (qei1lec) bits
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 254 preliminary ? 2011 microchip technology inc. register 17-15: qei1gech: greater than or equal compare high word register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 qeigec<31:24> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 qeigec<23:16> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 qeigec<31:16>: high word used to form 32-bit greater than or equal compare register (qei1gec) bits register 17-16: qei1gecl: greater than or equal compare low word register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 qeigec<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 qeigec<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 qeigec<15:0>: low word used to form 32-bit greater t han or equal compare register (qei1gec) bits register 17-17: intxtmrh: interval timer high word register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 inttmr<31:24> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 inttmr<23:16> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 inttmr<31:16>: high word used to form 32-bit interval timer register (intxtmr) bits
? 2011 microchip technology inc. preliminary ds70657d-page 255 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 17-18: intxtmrl: interval timer low word register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 inttmr<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 inttmr<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 inttmr<15:0>: low word used to form 32-bit inte rval timer register (intxtmr) bits register 17-19: intxhldh: interval timer hold high word register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 inthld<31:24> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 inthld<23:16> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 inthld<31:16>: hold register for reading and writing intxtmrh bits register 17-20: intxhldl: interval timer hold low word register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 inthld<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 inthld<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 inthld<15:0>: hold register for reading and writing intxtmrl bits
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 256 preliminary ? 2011 microchip technology inc. notes:
? 2011 microchip technology inc. preliminary ds70657d-page 257 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 18.0 serial peripheral interface (spi) the spi module is a synchronous serial interface use- ful for communicating with other peripheral or micro- controller devices. these peripheral devices can be serial eeproms, shift regist ers, display drivers, a/d converters, etc. the spi module is compatible with motorola?s spi and siop interfaces. the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/ 50x, and pic24epxxxgp/mc20 x device family offers two spi modules on a single device. these modules, which are designated as spi 1 and spi2, are function- ally identical. each spi mo dule includes an eight-word fifo buffer and allows dma bus connections. when using the spi module with dma, fifo operation can be disabled. the spi1 module uses dedicated pins which allow for a higher speed when using spi1. the spi2 module takes advantage of the pe ripheral pin select (pps) feature to allow for greater fl exibility in pin configuration of the spi2 module, but results in a lower maximum speed for spi2. see section 30.0 ?electrical characteristics? for more information. the spix serial interface consists of four pins, as follows: ? sdix: serial data input ? sdox: serial data output ? sckx: shift clock input or output ? ssx /fsyncx: active-low slave select or frame synchronization i/o pulse the spix module can be configured to operate with two, three or four pins. in 3-pin mode, ssx is not used. in 2-pin mode, neither sdox nor ssx is used. figure 18-1 illustrates the block diagram of the spi module in standard and enhanced modes. note 1: this data sheet summ arizes the features of the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x families of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to section 18. ?serial peripheral interface (spi)? (ds70569) of the ? dspic33e/pic24e family reference manual ?, which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for de vice-specific register and bit information. note: in this section, the spi modules are referred to together as spix, or separately as spi1 and spi2. special function registers follow a similar notation. for example, spixcon refers to the control register for the spi1 and spi2 module.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 258 preliminary ? 2011 microchip technology inc. figure 18-1: spix module block diagram internal data bus sdix sdox ssx /fsyncx sckx spixsr bit 0 shift control edge select f p primary 1:1/4/16/64 enable prescaler secondary prescaler 1:1 to 1:8 sync clock control spixbuf control transfer transfer write spixbuf read spixbuf 16 spixcon1<1:0> spixcon1<4:2> master clock 8-level fifo transmit buffer (1) 8-level fifo receive buffer (1) note 1: in standard mode, the fifo is only one level deep.
? 2011 microchip technology inc. preliminary ds70657d-page 259 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 18.1 spi helpful tips 1. in frame mode, if there is a possibility that the master may not be initialized before the slave: a) if frmpol (spixcon2<13>) = 1 , use a pull-down resistor on ssx . b) if frmpol = 0 , use a pull-up resistor on ssx . 2. in non-framed 3-wire mode, (i.e., not using ssx from a master): a) if ckp (spixcon1<6>) = 1 , always place a pull-up resistor on ssx . b) if ckp = 0 , always place a pull-down resistor on ssx . 3. frmen (spixcon2<15>) = 1 and ssen (spixcon1<7>) = 1 are exclusive and invalid. in frame mode, sckx is continuous and the frame sync pulse is active on the ssx pin, which indicates the start of a data frame. 4. in master mode only, set the smp bit (spixcon1<9>) to a ? 1 ? for the fastest spi data rate possible. the smp bit can only be set at the same time or after the msten bit (spixcon1<5>) is set. to avoid invalid slave read data to the master, the user?s master software must guarantee enough time for slave software to fill its write buffer before the user application initiate s a master write/read cycle. it is always advisable to preload the spixbuf transmit reg- ister in advance of the next master transaction cycle. spixbuf is transferred to the spi shift register and is empty once the data transmission begins. 18.2 spi resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 18.2.1 key resources ? section 18. ?serial peripheral interface? (ds70569) ? code samples ? application notes ? software libraries ? webinars ? all related dspic33e/pic24e family reference manuals sections ? development tools note: this insures that the first frame transmission after initialization is not shifted or corrupted. note: this will insure that during power-up and initialization the master/slave will not lose sync due to an errant sck transition that would cause the slave to accumulate data shift errors for both transmit and receive appearing as corrupted data. note: not all third-party devices support frame mode timing. refer to the spi electrical characteristics for details. note: in the event you are not able to access the product page using the link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 260 preliminary ? 2011 microchip technology inc. 18.3 spi control registers register 18-1: spixstat: spix status and control register r/w-0 u-0 r/w-0 u-0 u-0 r/w-0 r/w-0 r/w-0 spien ? spisidl ? ? spibec<2:0> bit 15 bit 8 r/w-0 r/c-0, hs r/w-0 r/w-0 r/w-0 r/w-0 r-0, hs, hc r-0, hs, hc srmpt spirov srxmpt si sel<2:0> spitbf spirbf bit 7 bit 0 legend: c = clearable bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown hs = set in hardware bit hc = cleared in hardware bit u = unimplemented bit, read as ?0? bit 15 spien: spix enable bit 1 = enables the module and configures sckx, sdox, sdix and ssx as serial port pins 0 = disables the module bit 14 unimplemented: read as ? 0 ? bit 13 spisidl: stop in idle mode bit 1 = discontinue the module operation when device enters idle mode 0 = continue the module operation in idle mode bit 12-11 unimplemented: read as ? 0 ? bit 10-8 spibec<2:0>: spix buffer element count bits (valid in enhanced buffer mode) master mode: number of spix transfers are pending. slave mode: number of spix transfers are unread. bit 7 srmpt: shift register (spixsr) empty bit (valid in enhanced buffer mode) 1 = spix shift register is empty and ready to send or receive the data 0 = spix shift register is not empty bit 6 spirov: receive overflow flag bit 1 = a new byte/word is completely received and discarded. the user application has not read the previous data in the spixbuf register 0 = no overflow has occurred bit 5 srxmpt: receive fifo empty bit (valid in enhanced buffer mode) 1 = rx fifo is empty 0 = rx fifo is not empty bit 4-2 sisel<2:0>: spix buffer interrupt mode bits (valid in enhanced buffer mode) 111 = interrupt when the spix transmit buffer is full (spixtbf bit is set) 110 = interrupt when last bit is shifted into spi xsr, and as a result, the tx fifo is empty 101 = interrupt when the last bit is shifted out of spixsr, and the transmit is complete 100 = interrupt when one data is shifted into the spixsr, and as a result, the tx fifo has one open memory location 011 = interrupt when the spix receive buffer is full (spixrbf bit set) 010 = interrupt when the spix receive buffer is 3/4 or more full 001 = interrupt when data is available in the receive buffer (srmpt bit is set) 000 = interrupt when the last data in the receive buffer is read, as a resu lt, the buffer is empty (srxmpt bit set)
? 2011 microchip technology inc. preliminary ds70657d-page 261 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x bit 1 spitbf: spix transmit buffer full status bit 1 = transmit not yet started, spixtxb is full 0 = transmit started, spixtxb is empty standard buffer mode: automatically set in hardware when core writ es to the spixbuf location, loading spixtxb. automatically cleared in hardware when spix modu le transfers data from spixtxb to spixsr. enhanced buffer mode: automatically set in hardware when cpu writes to the spixbuf location, loading the last available buffer location. automatically cleared in hardware when a buffer location is available for a cpu write operation. bit 0 spirbf: spix receive buffer full status bit 1 = receive complete, spixrxb is full 0 = receive is incomplete, spixrxb is empty standard buffer mode: automatically set in hardware when spix transfers data from spi xsr to spixrxb. automatically cleared in hardware when core reads the spixbuf location, reading spixrxb. enhanced buffer mode: automatically set in hardware when spix transfers data from spixsr to the buffer, filling the last unread buffer location. automatically cleared in hardware when a buffer location is available for a transfer from spixsr. register 18-1: spixstat: spix status and control register (continued)
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 262 preliminary ? 2011 microchip technology inc. register 18-2: spi x con1: spi x control register 1 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? ? dissck dissdo mode16 smp cke (1) bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ssen (2) ckp msten spre<2:0> (3) ppre<1:0> (3) bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-13 unimplemented: read as ? 0 ? bit 12 dissck: disable sckx pin bit (spi master modes only) 1 = internal spi clock is disabled, pin functions as i/o 0 = internal spi clock is enabled bit 11 dissdo: disable sdox pin bit 1 = sdox pin is not used by the module; pin functions as i/o 0 = sdox pin is controlled by the module bit 10 mode16: word/byte communication select bit 1 = communication is word-wide (16 bits) 0 = communication is byte-wide (8 bits) bit 9 smp: spix data input sample phase bit master mode: 1 = input data is sampled at end of data output time 0 = input data is sampled at middle of data output time slave mode: smp must be cleared when spix is used in slave mode. bit 8 cke: spix clock edge select bit (1) 1 = serial output data changes on transition from active clock state to idle clock state (refer to bit 6) 0 = serial output data changes on transition from idle clock state to active clock state (refer to bit 6) bit 7 ssen: slave select enable bit (slave mode) (2) 1 = ssx pin is used for slave mode 0 = ssx pin is not used by module. pin is controlled by port function bit 6 ckp: clock polarity select bit 1 = idle state for clock is a high le vel; active state is a low level 0 = idle state for clock is a low le vel; active state is a high level bit 5 msten: master mode enable bit 1 = master mode 0 = slave mode bit 4-2 spre<2:0>: secondary prescale bits (master mode) (3) 111 = secondary prescale 1:1 110 = secondary prescale 2:1 ? ? ? 000 = secondary prescale 8:1 bit 1-0 ppre<1:0>: primary prescale bits (master mode) (3) 11 = primary prescale 1:1 10 = primary prescale 4:1 01 = primary prescale 16:1 00 = primary prescale 64:1 note 1: the cke bit is not used in framed spi modes. program this bit to ? 0 ? for framed spi modes (frmen = 1 ). 2: this bit must be cleared when frmen = 1 . 3: do not set both primary and secondary prescalers to the value of 1:1.
? 2011 microchip technology inc. preliminary ds70657d-page 263 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 18-3: spi x con2: spi x control register 2 r/w-0 r/w-0 r/w-0 u-0 u-0 u-0 u-0 u-0 frmen spifsd frmpol ? ? ? ? ? bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 ? ? ? ? ? ? frmdly spiben bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 frmen: framed spix support bit 1 = framed spix support is enabled (ssx pin used as frame sync pulse input/output) 0 = framed spix support is disabled bit 14 spifsd: frame sync pulse direction control bit 1 = frame sync pulse input (slave) 0 = frame sync pulse output (master) bit 13 frmpol: frame sync pulse polarity bit 1 = frame sync pulse is active-high 0 = frame sync pulse is active-low bit 12-2 unimplemented: read as ? 0 ? bit 1 frmdly: frame sync pulse edge select bit 1 = frame sync pulse coincides with first bit clock 0 = frame sync pulse precedes first bit clock bit 0 spiben: enhanced buffer enable bit 1 = enhanced buffer is enabled 0 = enhanced buffer is disabled (standard mode)
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 264 preliminary ? 2011 microchip technology inc. notes:
? 2011 microchip technology inc. preliminary ds70657d-page 265 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 19.0 inter-integrated circuit? (i 2 c?) the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/ 50x, and pic24epxxxgp/mc20x family of devices contain two inter-integrated circuit (i 2 c) modules: i2c1 and i2c2. the i 2 c module provides complete hardware support for both slave and multi-master modes of the i 2 c serial communication standard, with a 16-bit interface. the i 2 c module has a 2-pin interface: ? the sclx pin is clock. ? the sdax pin is data. the i 2 c module offers the fo llowing key features: ?i 2 c interface supporting both master and slave modes of operation. ?i 2 c slave mode supports 7 and 10-bit address. ?i 2 c master mode supports 7 and 10-bit address. ?i 2 c port allows bidirectional transfers between master and slaves. ? serial clock synchronization for i 2 c port can be used as a handshake mechanism to suspend and resume serial transf er (sclrel control). ?i 2 c supports multi-master operation, detects bus collision and arbitrates accordingly. ? ipmi support ? smbus support note 1: this data sheet summ arizes the features of the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x families of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to section 19. ?inter-inte- grated circuit? (i 2 c?)? (ds70330) of the ? dspic33e/pic24e family refer- ence manual ?, which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for de vice-specific register and bit information.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 266 preliminary ? 2011 microchip technology inc. figure 19-1: i 2 c? block diagram ( x = 1 or 2) internal data bus sclx/asclx sdax/asdax shift match detect i2cxadd start and stop bit detect clock address match clock stretching i2cxtrn lsb shift clock brg down counter reload control f p /2 start and stop bit generation acknowledge generation collision detect i2cxcon i2cxstat control logic read lsb write read i2cxbrg i2cxrsr write read write read write read write read write read i2cxmsk i2cxrcv
? 2011 microchip technology inc. preliminary ds70657d-page 267 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 19.1 i 2 c resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 19.1.1 key resources ? section 19. ?inter-integrated circuit (i 2 c)? (ds70330) ? code samples ? application notes ? software libraries ? webinars ? all related dspic33e/pic24e family reference manuals sections ? development tools note: in the event you are not able to access the product page using t he link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 268 preliminary ? 2011 microchip technology inc. 19.2 i 2 c control registers register 19-1: i2cxcon: i2cx control register r/w-0 u-0 r/w-0 r/w-1 hc r/w-0 r/w-0 r/w-0 r/w-0 i2cen ? i2csidl sclrel ipmien (1) a10m disslw smen bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 hc r/w-0 hc r/w-0 hc r/w-0 hc r/w-0 hc gcen stren ackdt acken rcen pen rsen sen bit 7 bit 0 legend: u = unimplemented bit, read as ?0? r = readable bit w = writable bit hs = set in hardware hc = cleared in hardware -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 i2cen: i2cx enable bit 1 = enables the i2cx module and configures the sdax and sclx pins as serial port pins 0 = disables the i2cx module. all i 2 c? pins are controlled by port functions bit 14 unimplemented: read as ? 0 ? bit 13 i2csidl: stop in idle mode bit 1 = discontinue module operation when device enters an idle mode 0 = continue module operation in idle mode bit 12 sclrel: sclx release control bit (when operating as i 2 c slave) 1 = release sclx clock 0 = hold sclx clock low (clock stretch) if stren = 1 : bit is r/w (i.e., software can write ? 0 ? to initiate stretch and write ? 1 ? to release clock). hardware clear at beginning of every slave data byte transmission . hardware clear at end of every slave address byte reception. hardware clear at end of every slave data byte reception. if stren = 0 : bit is r/s (i.e., software can only write ? 1 ? to release clock). hardware clear at beginning of every slave data byte transmission. hardware clear at the end of every slave address byte reception. bit 11 ipmien: intelligent peripheral management interface (ipmi) enable bit (1) 1 = ipmi mode is enabled; all addresses acknowledged 0 = ipmi mode disabled bit 10 a10m: 10-bit slave address bit 1 = i2cxadd is a 10-bit slave address 0 = i2cxadd is a 7-bit slave address bit 9 disslw: disable slew rate control bit 1 = slew rate control disabled 0 = slew rate control enabled bit 8 smen: smbus input levels bit 1 = enable i/o pin thresholds co mpliant with smbus specification 0 = disable smbus input thresholds bit 7 gcen: general call enable bit (when operating as i 2 c slave) 1 = enable interrupt when a general call address is received in the i2cxrsr (module is enabled for reception) 0 = general call address disabled note 1: when performing master operations, ensure that the ipmien bit is ? 0 ?.
? 2011 microchip technology inc. preliminary ds70657d-page 269 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x bit 6 stren: sclx clock stretch enable bit (when operating as i 2 c slave) used in conjunction with sclrel bit. 1 = enable software or receive clock stretching 0 = disable software or receive clock stretching bit 5 ackdt: acknowledge data bit (when operating as i 2 c master, applicable during master receive) value that is transmitted when the software initiates an acknowledge sequence. 1 = send nack during acknowledge 0 = send ack during acknowledge bit 4 acken: acknowledge sequence enable bit (when operating as i 2 c master, applicable during master receive) 1 = initiate acknowledge sequence on sdax an d sclx pins and transmit ackdt data bit. hardware clear at end of master acknowledge sequence. 0 = acknowledge sequence not in progress bit 3 rcen: receive enable bit (when operating as i 2 c master) 1 = enables receive mode for i 2 c. hardware clear at end of eighth bit of master receive data byte. 0 = receive sequence not in progress bit 2 pen: stop condition enable bit (when operating as i 2 c master) 1 = initiate stop condition on sdax and sclx pins . hardware clear at end of master stop sequence. 0 = stop condition not in progress bit 1 rsen: repeated start condition enable bit (when operating as i 2 c master) 1 = initiate repeated start condition on sdax and sclx pins. hardware clear at end of master repeated start sequence. 0 = repeated start condition not in progress bit 0 sen: start condition enable bit (when operating as i 2 c master) 1 = initiate start condition on sdax and sclx pins . hardware clear at end of master start sequence. 0 = start condition not in progress register 19-1: i2cxcon: i2cx control register (continued) note 1: when performing master operations, ensure that the ipmien bit is ? 0 ?.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 270 preliminary ? 2011 microchip technology inc. register 19-2: i2cxstat: i2cx status register r-0 hsc r-0 hsc u-0 u-0 u-0 r/c-0 hs r-0 hsc r-0 hsc ackstat trstat ? ? ? bcl gcstat add10 bit 15 bit 8 r/c-0 hs r/c-0 hs r-0 hsc r/c-0 hsc r/c-0 hsc r-0 hsc r-0 hsc r-0 hsc iwcol i2cov d_a p s r_w rbf tbf bit 7 bit 0 legend: u = unimplemented bit, read as ?0? r = readable bit w = writable bit hs = set in hardware hsc = hardware set/cleared -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 ackstat: acknowledge status bit (when operating as i 2 c? master, applicable to master transmit operation) 1 = nack received from slave 0 = ack received from slave hardware set or clear at end of slave acknowledge. bit 14 trstat: transmit status bit (when operating as i 2 c master, applicable to master transmit operation) 1 = master transmit is in progress (8 bits + ack) 0 = master transmit is not in progress hardware set at beginning of master transmission . hardware clear at end of slave acknowledge. bit 13-11 unimplemented: read as ? 0 ? bit 10 bcl: master bus collision detect bit 1 = a bus collision has been detec ted during a master operation 0 = no collision hardware set at detection of bus collision. bit 9 gcstat: general call status bit 1 = general call address was received 0 = general call address was not received hardware set when address matches general call address. hardware clear at stop detection. bit 8 add10: 10-bit address status bit 1 = 10-bit address was matched 0 = 10-bit address was not matched hardware set at match of 2nd byte of matched 10 -bit address. hardware clear at stop detection. bit 7 iwcol: write collision detect bit 1 = an attempt to write the i2cx trn register failed because the i 2 c module is busy 0 = no collision hardware set at occurrence of write to i2cxtrn while busy (cleared by software). bit 6 i2cov: receive overflow flag bit 1 = a byte was received while the i2cxrcv re gister is still holding the previous byte 0 = no overflow hardware set at attempt to transfer i2cxrsr to i2cxrcv (cleared by software). bit 5 d_a: data/address bit (when operating as i 2 c slave) 1 = indicates that the last byte received was data 0 = indicates that the last byte received was device address hardware clear at device address match. hardware set by reception of slave byte. bit 4 p: stop bit 1 = indicates that a stop bit has been detected last 0 = stop bit was not detected last hardware set or clear when start, repeated start or stop detected.
? 2011 microchip technology inc. preliminary ds70657d-page 271 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x bit 3 s: start bit 1 = indicates that a start (or repeated start) bit has been detected last 0 = start bit was not detected last hardware set or clear when start, repeated start or stop detected. bit 2 r_w: read/write information bit (when operating as i 2 c slave) 1 = read ? indicates data transfer is output from slave 0 = write ? indicates data transfer is input to slave hardware set or clear after reception of i 2 c device address byte. bit 1 rbf: receive buffer full status bit 1 = receive complete, i2cxrcv is full 0 = receive not complete, i2cxrcv is empty hardware set when i2cxrcv is written with received byte. hardware clear when software reads i2cxrcv. bit 0 tbf: transmit buffer full status bit 1 = transmit in progress, i2cxtrn is full 0 = transmit complete, i2cxtrn is empty hardware set when software writes i2cxtrn. hard ware clear at completion of data transmission. register 19-2: i2cxstat: i2cx status register (continued)
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 272 preliminary ? 2011 microchip technology inc. register 19-3: i2cxmsk: i2cx sl ave mode address mask register u-0 u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 ? ? ? ? ? ? amsk9 amsk8 bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 amsk7 amsk6 amsk5 amsk4 amsk3 amsk2 amsk1 amsk0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-10 unimplemented: read as ? 0 ? bit 9-0 amskx: mask for address bit x select bit for 10-bit address: 1 = enable masking for bit ax of incoming message a ddress; bit match is not required in this position 0 = disable masking for bit ax; bit match is required in this position for 7-bit address (i2cxmsk<6:0> only): 1 = enable masking for bit ax + 1 of incoming mess age address; bit match is not required in this position 0 = disable masking for bit ax + 1; bit match is required in this position
? 2011 microchip technology inc. preliminary ds70657d-page 273 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 20.0 universal asynchronous receiver transmitter (uart) the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/ 50x, and pic24epxxxgp/mc20x family of devices contain two uart modules. the universal asynchronous receiver transmitter (uart) module is one of the serial i/o modules available in the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/ mc20x device family. the uart is a full-duplex asynchronous system that can communicate with peripheral devices, such as personal computers, lin, rs-232 and rs-485 interfaces. the module also supports a hardware flow control option with the uxcts and uxrts pins and also includes an irda ? encoder and decoder. the primary features of the uart module are: ? full-duplex, 8- or 9-bit data transmission through the uxtx and uxrx pins ? even, odd or no parity options (for 8-bit data) ? one or two stop bits ? hardware flow control option with uxcts and uxrts pins ? fully integrated baud rate generator with 16-bit prescaler ? baud rates ranging from 4.375 mbps to 67 bps at 16x mode at 70 mips ? baud rates ranging from 17.5 mbps to 267 bps at 4x mode at 70 mips ? 4-deep first-in first-out (fifo) transmit data buffer ? 4-deep fifo receive data buffer ? parity, framing and buffer overrun error detection ? support for 9-bit mode with address detect (9th bit = 1 ) ? transmit and receive interrupts ? a separate interrupt for all uart error conditions ? loopback mode for diagnostic support ? support for sync and break characters ? support for automatic baud rate detection ?irda ? encoder and decoder logic ? 16x baud clock output for irda ? support a simplified block diagram of the uart module is shown in figure 20-1 . the uart module consists of these key hardware elements: ? baud rate generator ? asynchronous transmitter ? asynchronous receiver figure 20-1: uart simplified block diagram note 1: this data sheet summ arizes the features of the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x families of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to section 17. ?uart? (ds70582) of the ? dspic33e/pic24e family reference manual ?, which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for de vice-specific register and bit information. note: hardware flow control using uxrts and uxcts is not available on all pin count devices. see the ?pin diagrams? section for availability. uxrx hardware flow control uart receiver uart transmitter uxtx baud rate generator uxrts /bclkx irda ? uxcts
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 274 preliminary ? 2011 microchip technology inc. 20.1 uart helpful tips 1. in multi-node direct-connect uart networks, uart receive inputs react to the complementary logic level defined by the urxinv bit (uxmode<4>), which defines the idle state, the default of which is logic high, (i.e., urxinv = 0 ). because remote devices do not initialize at the same time , it is likely that one of the devices, because the rx line is floating, will trigger a start bit detection and will cause the first byte received after the device has been ini- tialized to be invalid. to avoid this situation, the user should use a pull-up or pull-down resistor on the rx pin depending on the value of the urxinv bit. a) if urxinv = 0 , use a pull-up resistor on the rx pin. b) if urxinv = 1 , use a pull-down resistor on the rx pin. 2. the first character received on a wake-up from sleep mode caused by activity on the uxrx pin of the uart module will be invalid. in sleep mode, peripheral clocks are disabled. by the time the oscillator system has restarted and stabilized from sleep mode, the baud rate bit sampling clock relative to the incoming uxrx bit timing is no longer synchronized, resulting in the first character being invalid. this is to be expected. 20.2 uart resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 20.2.1 key resources ? section 17. ?uart? (ds70582) ? code samples ? application notes ? software libraries ? webinars ? all related dspic33e/pic24e family reference manuals sections ? development tools note: in the event you are not able to access the product page using the link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
? 2011 microchip technology inc. preliminary ds70657d-page 275 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 20.3 uart control registers register 20-1: uxmode: uart x mode register r/w-0 u-0 r/w-0 r/w-0 r/w-0 u-0 r/w-0 r/w-0 uarten (1) ? usidl iren (2) rtsmd ?uen<1:0> bit 15 bit 8 r/w-0 hc r/w-0 r/w-0 hc r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 wake lpback abaud urxinv brgh pdsel<1:0> stsel bit 7 bit 0 legend: hc = hardware cleared r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 uarten: uartx enable bit 1 = uartx is enabled; all uartx pins are controlled by uartx as defined by uen<1:0> 0 = uartx is disabled; all uartx pins are contro lled by port latches; uartx power consumption minimal bit 14 unimplemented: read as ? 0 ? bit 13 usidl: stop in idle mode bit 1 = discontinue module operation when device enters idle mode 0 = continue module operation in idle mode bit 12 iren: irda ? encoder and decoder enable bit (2) 1 = irda encoder and decoder enabled 0 = irda encoder and decoder disabled bit 11 rtsmd: mode selection for uxrts pin bit 1 =uxrts pin in simplex mode 0 =uxrts pin in flow control mode bit 10 unimplemented: read as ? 0 ? bit 9-8 uen<1:0>: uartx pin enable bits 11 = uxtx, uxrx and bclkx pins are enabled and used; uxcts pin controlled by port latches (3) 10 = uxtx, uxrx, uxcts and uxrts pins are enabled and used (4) 01 = uxtx, uxrx and uxrts pins are enabled and used; uxcts pin controlled by port latches (4) 00 = uxtx and uxrx pins are enabled and used; uxcts and uxrts /bclkx pins controlled by port latches bit 7 wake: wake-up on start bit detect during sleep mode enable bit 1 = uartx continues to sample the uxrx pin; interrupt generated on falling edge; bit cleared in hardware on following rising edge 0 = no wake-up enabled bit 6 lpback: uartx loopback mode select bit 1 = enable loopback mode 0 = loopback mode is disabled note 1: refer to section 17. ?uart? (ds70582) in the ?dspic33e/pic24e family reference manual? for infor- mation on enabling the uart module for receive or transmit operation. 2: this feature is only available for the 16x brg mode (brgh = 0 ). 3: this feature is only available on 44-pin and 64-pin devices. 4: this feature is only available on 64-pin devices.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 276 preliminary ? 2011 microchip technology inc. bit 5 abaud: auto-baud enable bit 1 = enable baud rate measurement on the next character ? requires reception of a sync field (55h) before other data; cleared in hardware upon completion 0 = baud rate measurement disabled or completed bit 4 urxinv: receive polarity inversion bit 1 = uxrx idle state is ? 0 ? 0 = uxrx idle state is ? 1 ? bit 3 brgh: high baud rate enable bit 1 = brg generates 4 clocks per bit period (4x baud clock, high-speed mode) 0 = brg generates 16 clocks per bit period (16x baud clock, standard mode) bit 2-1 pdsel<1:0>: parity and data selection bits 11 = 9-bit data, no parity 10 = 8-bit data, odd parity 01 = 8-bit data, even parity 00 = 8-bit data, no parity bit 0 stsel: stop bit selection bit 1 = two stop bits 0 = one stop bit register 20-1: uxmode: uart x mode register (continued) note 1: refer to section 17. ?uart? (ds70582) in the ?dspic33e/pic24e family reference manual? for infor- mation on enabling the uart module for receive or transmit operation. 2: this feature is only available for the 16x brg mode (brgh = 0 ). 3: this feature is only available on 44-pin and 64-pin devices. 4: this feature is only available on 64-pin devices.
? 2011 microchip technology inc. preliminary ds70657d-page 277 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 20-2: u x sta: uart x status and control register r/w-0 r/w-0 r/w-0 u-0 r/w-0 hc r/w-0 r-0 r-1 utxisel1 utxinv utxisel0 ? utxbrk utxen (1) utxbf trmt bit 15 bit 8 r/w-0 r/w-0 r/w-0 r-1 r-0 r-0 r/c-0 r-0 urxisel<1:0> adden ridle perr ferr oerr urxda bit 7 bit 0 legend: hc = hardware cleared r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15,13 utxisel<1:0>: transmission interrupt mode selection bits 11 = reserved; do not use 10 = interrupt when a character is transferred to the transmit shift register, and as a result, the transmit buffer becomes empty 01 = interrupt when the last character is shifted ou t of the transmit shift register; all transmit operations are completed 00 = interrupt when a character is transferred to t he transmit shift register (this implies there is at least one character open in the transmit buffer) bit 14 utxinv: transmit polarity inversion bit if iren = 0 : 1 = uxtx idle state is ? 0 ? 0 = uxtx idle state is ? 1 ? if iren = 1 : 1 = irda encoded uxtx idle state is ? 1 ? 0 = irda encoded uxtx idle state is ? 0 ? bit 12 unimplemented: read as ? 0 ? bit 11 utxbrk: transmit break bit 1 = send sync break on next transmission ? start bit, followed by twelve ? 0 ? bits, followed by stop bit; cleared by hardware upon completion 0 = sync break transmission disabled or completed bit 10 utxen: transmit enable bit (1) 1 = transmit enabled, uxtx pin controlled by uartx 0 = transmit disabled, any pending transmission is abo rted and buffer is reset. uxtx pin controlled by port. bit 9 utxbf: transmit buffer full status bit (read-only) 1 = transmit buffer is full 0 = transmit buffer is not full, at least one more character can be written bit 8 trmt: transmit shift register empty bit (read-only) 1 = transmit shift register is em pty and transmit buffer is empty (the last transmission has completed) 0 = transmit shift register is not empty, a transmission is in progress or queued bit 7-6 urxisel<1:0>: receive interrupt mode selection bits 11 = interrupt is set on uxrsr transfer making the receive buffer full (i.e., has 4 data characters) 10 = interrupt is set on uxrsr transfer making the re ceive buffer 3/4 full (i.e., has 3 data characters) 0x = interrupt is set when any character is receiv ed and transferred from the uxrsr to the receive buffer. receive buffer has one or more characters. note 1: refer to section 17. ?uart? (ds70582) in the ?dspic33e/pic24e family reference manual? for information on enabling the uart module for transmit operation.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 278 preliminary ? 2011 microchip technology inc. bit 5 adden: address character detect bit (bit 8 of received data = 1 ) 1 = address detect mode enabled. if 9-bit mode is not selected, this does not take effect. 0 = address detect mode disabled bit 4 ridle: receiver idle bit (read-only) 1 = receiver is idle 0 = receiver is active bit 3 perr: parity error status bit (read-only) 1 = parity error has been detected for the current ch aracter (character at the top of the receive fifo) 0 = parity error has not been detected bit 2 ferr: framing error status bit (read-only) 1 = framing error has been detected for the current character (character at the top of the receive fifo) 0 = framing error has not been detected bit 1 oerr: receive buffer overrun error status bit (read/clear only) 1 = receive buffer has overflowed 0 = receive buffer has not overflowed. clearing a previously set oerr bit ( 1 0 transition) resets the receiver buffer and t he uxrsr to the empty state. bit 0 urxda: receive buffer data available bit (read-only) 1 = receive buffer has data, at least one more character can be read 0 = receive buffer is empty register 20-2: u x sta: uart x status and control register (continued) note 1: refer to section 17. ?uart? (ds70582) in the ?dspic33e/pic24e family reference manual? for information on enabling the uart module for transmit operation.
? 2011 microchip technology inc. preliminary ds70657d-page 279 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 21.0 enhanced can (ecan?) module (dspic33epxxxgp/ mc50x devices only) 21.1 overview the enhanced controller area network (ecan) module is a serial interfac e, useful for communicat- ing with other can modul es or microcontroller devices. this interface/protocol was designed to allow communications within noisy environments. the dspic33epxxxgp/mc50x devices contain one ecan module. the ecan module is a communication controller implementing the can 2.0 a/b protocol, as defined in the bosch can specificatio n. the module supports can 1.2, can 2.0a, can 2.0b passive and can 2.0b active versions of the prot ocol. the module implemen- tation is a full can system. the can specification is not covered within this data sheet. the reader can refer to the bosch can specification for further details. the ecan module features are as follows: ? implementation of the can protocol, can 1.2, can 2.0a and can 2.0b ? standard and extended data frames ? 0-8 bytes data length ? programmable bit rate up to 1 mbit/sec ? automatic response to remote transmission requests ? up to eight transmit buffers with application speci- fied prioritization and abort capability (each buffer can contain up to 8 bytes of data) ? up to 32 receive buffers (each buffer can contain up to 8 bytes of data) ? up to 16 full (standard/extended identifier) acceptance filters ? three full acceptance filter masks ? devicenet? addressing support ? programmable wake-up functionality with integrated low-pass filter ? programmable loopback mode supports self-test operation ? signaling via interrupt capabilities for all can receiver and transm itter error states ? programmable clock source ? programmable link to input capture module (ic2) for time-stamping and network synchronization ? low-power sleep and idle mode the can bus module consists of a protocol engine and message buffering/control. the can protocol engine handles all functions for receiving and transmitting messages on the can bus. messages are transmitted by first loading the appropriate data registers. status and errors can be checked by reading the appropriate registers. any message detected on the can bus is checked for errors and then matched against filters to see if it should be received and stored in one of the receive registers. note 1: this data sheet summ arizes the features of the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x families of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to section 21. ?enhanced controller area network (ecan?)? (ds70353) of the ? dspic33e/pic24e family reference manual ?, which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for de vice-specific register and bit information.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 280 preliminary ? 2011 microchip technology inc. figure 21-1: ecan? module block diagram message assembly can protocol engine citx buffer cirx rxf14 filter rxf13 filter rxf12 filter rxf11 filter rxf10 filter rxf9 filter rxf8 filter rxf7 filter rxf6 filter rxf5 filter rxf4 filter rxf3 filter rxf2 filter rxf1 filter rxf0 filter transmit byte sequencer rxm1 mask rxm0 mask control configuration logic cpu bus interrupts trb0 tx/rx buffer control register dma controller rxf15 filter rxm2 mask trb7 tx/rx buffer control register trb6 tx/rx buffer control register trb5 tx/rx buffer control register trb4 tx/rx buffer control register trb3 tx/rx buffer control register trb2 tx/rx buffer control register trb1 tx/rx buffer control register
? 2011 microchip technology inc. preliminary ds70657d-page 281 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 21.2 modes of operation the ecan module can operate in one of several operation modes selected by the user. these modes include: ? initialization mode ? disable mode ? normal operation mode ? listen only mode ? listen all messages mode ? loopback mode modes are requested by se tting the reqop<2:0> bits (cictrl1<10:8>). entry into a mode is acknowledged by monitoring the opmode<2:0> bits (cictrl1<7:5>). the modul e does not change the mode and the opmode bits until a change in mode is acceptable, generally during bus idle time, which is defined as at least 11 consecutive recessive bits. 21.3 ecan resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 21.3.1 key resources ? section 21. ?enhanced controller area network (ecan?)? (ds70353) ? code samples ? application notes ? software libraries ? webinars ? all related dspic33e/pic24e family reference manuals sections ? development tools note: in the event you are not able to access the product page using the link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 282 preliminary ? 2011 microchip technology inc. 21.4 ecan control registers register 21-1: cictrl1: ecan? control register 1 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-1 r/w-0 r/w-0 ? ? csidl abat cancks reqop<2:0> bit 15 bit 8 r-1 r-0 r-0 u-0 r/w-0 u-0 u-0 r/w-0 opmode<2:0> ?cancap ? ?win bit 7 bit 0 legend: c = writable bit, but only ?0? can be written to clear the bit r = bit is reserved r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13 csidl: stop in idle mode bit 1 = discontinue module operation when device enters idle mode 0 = continue module operation in idle mode bit 12 abat: abort all pending transmissions bit 1 = signal all transmit buffers to abort transmission 0 = module will clear this bit when all transmissions are aborted bit 11 cancks: ecan module clock (f can ) source select bit 1 = f can is equal to 2 * f p 0 = f can is equal to f p bit 10-8 reqop<2:0>: request operation mode bits 111 = set listen all messages mode 110 = reserved 101 = reserved 100 = set configuration mode 011 = set listen only mode 010 = set loopback mode 001 = set disable mode 000 = set normal operation mode bit 7-5 opmode<2:0> : operation mode bits 111 = module is in listen all messages mode 110 = reserved 101 = reserved 100 = module is in configuration mode 011 = module is in listen only mode 010 = module is in loopback mode 001 = module is in disable mode 000 = module is in normal operation mode bit 4 unimplemented: read as ? 0 ? bit 3 cancap: can message receive timer capture event enable bit 1 = enable input capture based on can message receive 0 = disable can capture bit 2-1 unimplemented: read as ? 0 ? bit 0 win: sfr map window select bit 1 = use filter window 0 = use buffer window
? 2011 microchip technology inc. preliminary ds70657d-page 283 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 21-2: cictrl2: ecan? control register 2 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 u-0 u-0 r-0 r-0 r-0 r-0 r-0 ? ? ? dncnt<4:0> bit 7 bit 0 legend: c = writable bit, but only ?0? can be written to clear the bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-5 unimplemented: read as ? 0 ? bit 4-0 dncnt<4:0>: devicenet? filter bit number bits 10010-11111 = invalid selection 10001 = compare up to data byte 3, bit 6 with eid<17> ? ? ? 00001 = compare up to data byte 1, bit 7 with eid<0> 00000 = do not compare data bytes
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 284 preliminary ? 2011 microchip technology inc. register 21-3: civec: ecan? interrupt code register u-0 u-0 u-0 r-0 r-0 r-0 r-0 r-0 ? ? ? filhit<4:0> bit 15 bit 8 u-0 r-1 r-0 r-0 r-0 r-0 r-0 r-0 ?icode<6:0> bit 7 bit 0 legend: c = writable bit, but only ?0? can be written to clear the bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-13 unimplemented: read as ? 0 ? bit 12-8 filhit<4:0>: filter hit number bits 10000-11111 = reserved 01111 = filter 15 ? ? ? 00001 = filter 1 00000 = filter 0 bit 7 unimplemented: read as ? 0 ? bit 6-0 icode<6:0>: interrupt flag code bits 1000101-1111111 = reserved 1000100 = fifo almost full interrupt 1000011 = receiver overflow interrupt 1000010 = wake-up interrupt 1000001 = error interrupt 1000000 = no interrupt ? ? ? 0010000-0111111 = reserved 0001111 = rb15 buffer interrupt ? ? ? 0001001 = rb9 buffer interrupt 0001000 = rb8 buffer interrupt 0000111 = trb7 buffer interrupt 0000110 = trb6 buffer interrupt 0000101 = trb5 buffer interrupt 0000100 = trb4 buffer interrupt 0000011 = trb3 buffer interrupt 0000010 = trb2 buffer interrupt 0000001 = trb1 buffer interrupt 0000000 = trb0 buffer interrupt
? 2011 microchip technology inc. preliminary ds70657d-page 285 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 21-4: cifctrl: ecan? fifo control register r/w-0 r/w-0 r/w-0 u-0 u-0 u-0 u-0 u-0 dmabs<2:0> ? ? ? ? ? bit 15 bit 8 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? ? fsa<4:0> bit 7 bit 0 legend: c = writable bit, but only ?0? can be written to clear the bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-13 dmabs<2:0>: dma buffer size bits 111 = reserved 110 = 32 buffers in ram 101 = 24 buffers in ram 100 = 16 buffers in ram 011 = 12 buffers in ram 010 = 8 buffers in ram 001 = 6 buffers in ram 000 = 4 buffers in ram bit 12-5 unimplemented: read as ? 0 ? bit 4-0 fsa<4:0>: fifo area starts with buffer bits 11111 = read buffer rb31 11110 = read buffer rb30 ? ? ? 00001 = tx/rx buffer trb1 00000 = tx/rx buffer trb0
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 286 preliminary ? 2011 microchip technology inc. register 21-5: cififo: e can? fifo status register u-0 u-0 r-0 r-0 r-0 r-0 r-0 r-0 ? ? fbp<5:0> bit 15 bit 8 u-0 u-0 r-0 r-0 r-0 r-0 r-0 r-0 ? ? fnrb<5:0> bit 7 bit 0 legend: c = writable bit, but only ?0? can be written to clear the bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13-8 fbp<5:0>: fifo buffer pointer bits 011111 = rb31 buffer 011110 = rb30 buffer ? ? ? 000001 = trb1 buffer 000000 = trb0 buffer bit 7-6 unimplemented: read as ? 0 ? bit 5-0 fnrb<5:0>: fifo next read buffer pointer bits 011111 = rb31 buffer 011110 = rb30 buffer ? ? ? 000001 = trb1 buffer 000000 = trb0 buffer
? 2011 microchip technology inc. preliminary ds70657d-page 287 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 21-6: ciintf: ec an? interrupt flag register u-0 u-0 r-0 r-0 r-0 r-0 r-0 r-0 ? ? txbo txbp rxbp txwar rxwar ewarn bit 15 bit 8 r/c-0 r/c-0 r/c-0 u-0 r/c-0 r/c-0 r/c-0 r/c-0 ivrif wakif errif ? fifoif rbovif rbif tbif bit 7 bit 0 legend: c = writable bit, but only ?0? can be written to clear the bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as ? 0 ? bit 13 txbo: transmitter in error state bus off bit 1 = transmitter is in bus off state 0 = transmitter is not in bus off state bit 12 txbp: transmitter in error state bus passive bit 1 = transmitter is in bus passive state 0 = transmitter is not in bus passive state bit 11 rxbp: receiver in error state bus passive bit 1 = receiver is in bus passive state 0 = receiver is not in bus passive state bit 10 txwar: transmitter in error state warning bit 1 = transmitter is in error warning state 0 = transmitter is not in error warning state bit 9 rxwar: receiver in error state warning bit 1 = receiver is in error warning state 0 = receiver is not in error warning state bit 8 ewarn: transmitter or receiver in error state warning bit 1 = transmitter or receiver is in error state warning state 0 = transmitter or receiver is not in error state warning state bit 7 ivrif: invalid message interrupt flag bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 6 wakif: bus wake-up activity interrupt flag bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 5 errif: error interrupt flag bit (multiple sources in ciintf< 13:8> register) 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 4 unimplemented: read as ? 0 ? bit 3 fifoif: fifo almost full interrupt flag bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 2 rbovif: rx buffer overflow interrupt flag bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 1 rbif: rx buffer interrupt flag bit 1 = interrupt request has occurred 0 = interrupt request has not occurred bit 0 tbif: tx buffer interrupt flag bit 1 = interrupt request has occurred 0 = interrupt request has not occurred
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 288 preliminary ? 2011 microchip technology inc. register 21-7: ciinte: ecan? interrupt enable register u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ivrie wakie errie ? fifoie rbovie rbie tbie bit 7 bit 0 legend: c = writable bit, but only ?0? can be written to clear the bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-8 unimplemented: read as ? 0 ? bit 7 ivrie: invalid message interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 6 wakie: bus wake-up activity interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 5 errie: error interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 4 unimplemented: read as ? 0 ? bit 3 fifoie: fifo almost full interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 2 rbovie: rx buffer overflow interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 1 rbie: rx buffer interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled bit 0 tbie: tx buffer interrupt enable bit 1 = interrupt request enabled 0 = interrupt request not enabled
? 2011 microchip technology inc. preliminary ds70657d-page 289 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 21-8: ciec: ecan? tran smit/receive error count register r-0 r-0 r-0 r-0 r-0 r-0 r-0 r-0 terrcnt<7:0> bit 15 bit 8 r-0 r-0 r-0 r-0 r-0 r-0 r-0 r-0 rerrcnt<7:0> bit 7 bit 0 legend: c = writable bit, but only ?0? can be written to clear the bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-8 terrcnt<7:0>: transmit error count bits bit 7-0 rerrcnt<7:0>: receive error count bits register 21-9: cicfg1: ecan? b aud rate configuration register 1 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 sjw<1:0> brp<5:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-8 unimplemented: read as ? 0 ? bit 7-6 sjw<1:0>: synchronization jump width bits 11 = length is 4 x t q 10 = length is 3 x t q 01 = length is 2 x t q 00 = length is 1 x t q bit 5-0 brp<5:0>: baud rate prescaler bits 11 1111 = t q = 2 x 64 x 1/f can ? ? ? 00 0010 = t q = 2 x 3 x 1/f can 00 0001 = t q = 2 x 2 x 1/f can 00 0000 = t q = 2 x 1 x 1/f can
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 290 preliminary ? 2011 microchip technology inc. register 21-10: cicfg2: ecan? b aud rate configuration register 2 u-0 r/w-x u-0 u-0 u-0 r/w-x r/w-x r/w-x ? wakfil ? ? ? seg2ph<2:0> bit 15 bit 8 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x seg2phts sam seg1ph <2:0> prseg<2:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14 wakfil: select can bus line filter for wake-up bit 1 = use can bus line filter for wake-up 0 = can bus line filter is not used for wake-up bit 13-11 unimplemented: read as ? 0 ? bit 10-8 seg2ph<2:0>: phase segment 2 bits 111 = length is 8 x t q ? ? ? 000 = length is 1 x t q bit 7 seg2phts: phase segment 2 time select bit 1 = freely programmable 0 = maximum of seg1ph bits or information pr ocessing time (ipt), whichever is greater bit 6 sam: sample of the can bus line bit 1 = bus line is sampled three times at the sample point 0 = bus line is sampled once at the sample point bit 5-3 seg1ph<2:0>: phase segment 1 bits 111 = length is 8 x t q ? ? ? 000 = length is 1 x t q bit 2-0 prseg<2:0>: propagation time segment bits 111 = length is 8 x t q ? ? ? 000 = length is 1 x t q
? 2011 microchip technology inc. preliminary ds70657d-page 291 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 21-11: cifen1: ecan? acceptance filter enable register 1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 flten15 flten14 flten13 flten12 flten11 flten10 flten9 flten8 bit 15 bit 8 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 flten7 flten6 flten5 flten4 flten3 flten2 flten1 flten0 bit 7 bit 0 legend: c = writable bit, but only ?0? can be written to clear the bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 fltenn: enable filter n to accept messages bits 1 = enable filter n 0 = disable filter n register 21-12: cibufpnt1: ecan? filter 0-3 buffer pointer register 1 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 f3bp<3:0> f2bp<3:0> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 f1bp<3:0> f0bp<3:0> bit 7 bit 0 legend: c = writable bit, but only ?0? can be written to clear the bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-12 f3bp<3:0>: rx buffer mask for filter 3 bits 1111 = filter hits received in rx fifo buffer 1110 = filter hits received in rx buffer 14 ? ? ? 0001 = filter hits received in rx buffer 1 0000 = filter hits received in rx buffer 0 bit 11-8 f2bp<3:0>: rx buffer mask for filter 2 bits (same values as bit 15-12) bit 7-4 f1bp<3:0>: rx buffer mask for filter 1 bits (same values as bit 15-12) bit 3-0 f0bp<3:0>: rx buffer mask for filter 0 bits (same values as bit 15-12)
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 292 preliminary ? 2011 microchip technology inc. register 21-13: cibufpnt2: ecan? filter 4-7 buffer pointer register 2 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 f7bp<3:0> f6bp<3:0> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 f5bp<3:0> f4bp<3:0> bit 7 bit 0 legend: c = writable bit, but only ?0? can be written to clear the bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-12 f7bp<3:0>: rx buffer mask for filter 7 bits 1111 = filter hits received in rx fifo buffer 1110 = filter hits received in rx buffer 14 ? ? ? 0001 = filter hits received in rx buffer 1 0000 = filter hits received in rx buffer 0 bit 11-8 f6bp<3:0>: rx buffer mask for filter 6 bits (same values as bit 15-12) bit 7-4 f5bp<3:0>: rx buffer mask for filter 5 bits (same values as bit 15-12) bit 3-0 f4bp<3:0>: rx buffer mask for filter 4 bits (same values as bit 15-12) register 21-14: cibufpnt3: ecan? filte r 8-11 buffer pointer register 3 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 f11bp<3:0> f10bp<3:0> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 f9bp<3:0> f8bp<3:0> bit 7 bit 0 legend: c = writable bit, but only ?0? can be written to clear the bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-12 f11bp<3:0>: rx buffer mask for filter 11 bits 1111 = filter hits received in rx fifo buffer 1110 = filter hits received in rx buffer 14 ? ? ? 0001 = filter hits received in rx buffer 1 0000 = filter hits received in rx buffer 0 bit 11-8 f10bp<3:0>: rx buffer mask for filter 10 bits (same values as bit 15-12) bit 7-4 f9bp<3:0>: rx buffer mask for filter 9 bits (same values as bit 15-12) bit 3-0 f8bp<3:0>: rx buffer mask for filter 8 bits (same values as bit 15-12)
? 2011 microchip technology inc. preliminary ds70657d-page 293 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 21-15: cibufpnt4: ecan? filter 12-15 buffer pointer register 4 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 f15bp<3:0> f14bp<3:0> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 f13bp<3:0> f12bp<3:0> bit 7 bit 0 legend: c = writable bit, but only ?0? can be written to clear the bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-12 f15bp<3:0>: rx buffer mask for filter 15 bits 1111 = filter hits received in rx fifo buffer 1110 = filter hits received in rx buffer 14 ? ? ? 0001 = filter hits received in rx buffer 1 0000 = filter hits received in rx buffer 0 bit 11-8 f14bp<3:0>: rx buffer mask for filter 14 bits (same values as bit 15-12) bit 7-4 f13bp<3:0>: rx buffer mask for filter 13 bits (same values as bit 15-12) bit 3-0 f12bp<3:0>: rx buffer mask for filter 12 bits (same values as bit 15-12)
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 294 preliminary ? 2011 microchip technology inc. register 21-16: cirxfnsid: ecan? accepta nce filter standard identifier register n (n = 0-15) r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x sid10 sid9 sid8 sid7 sid6 sid5 sid4 sid3 bit 15 bit 8 r/w-x r/w-x r/w-x u-0 r/w-x u-0 r/w-x r/w-x sid2 sid1 sid0 ?exide ?eid17eid16 bit 7 bit 0 legend: c = writable bit, but only ?0? can be written to clear the bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-5 sid<10:0>: standard identifier bits 1 = message address bit sidx must be ? 1 ? to match filter 0 = message address bit sidx must be ? 0 ? to match filter bit 4 unimplemented: read as ? 0 ? bit 3 exide: extended identifier enable bit if mide = 1 : 1 = match only messages with extended identifier addresses 0 = match only messages with standard identifier addresses i f mide = 0 : ignore exide bit. bit 2 unimplemented: read as ? 0 ? bit 1-0 eid<17:16>: extended identifier bits 1 = message address bit eidx must be ? 1 ? to match filter 0 = message address bit eidx must be ? 0 ? to match filter
? 2011 microchip technology inc. preliminary ds70657d-page 295 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 21-17: cirxfneid: ecan? acceptan ce filter extended identifier register n (n = 0-15) r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x eid15 eid14 eid13 eid12 eid11 eid10 eid9 eid8 bit 15 bit 8 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x eid7 eid6 eid5 eid4 eid3 eid2 eid1 eid0 bit 7 bit 0 legend: c = writable bit, but only ?0? can be written to clear the bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 eid<15:0>: extended identifier bits 1 = message address bit eidx must be ? 1 ? to match filter 0 = message address bit eidx must be ? 0 ? to match filter register 21-18: cifmsksel1: ecan? filter 7-0 mask selection register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 f7msk<1:0> f6msk<1:0> f5msk<1:0> f4msk<1:0> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 f3msk<1:0> f2msk<1:0> f1msk<1:0> f0msk<1:0> bit 7 bit 0 legend: c = writable bit, but only ?0? can be written to clear the bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 f7msk<1:0>: mask source for filter 7 bit 11 = reserved 10 = acceptance mask 2 registers contain mask 01 = acceptance mask 1 registers contain mask 00 = acceptance mask 0 registers contain mask bit 13-12 f6msk<1:0>: mask source for filter 6 bit (same values as bit 15-14) bit 11-10 f5msk<1:0>: mask source for filter 5 bit (same values as bit 15-14) bit 9-8 f4msk<1:0>: mask source for filter 4 bit (same values as bit 15-14) bit 7-6 f3msk<1:0>: mask source for filter 3 bit (same values as bit 15-14) bit 5-4 f2msk<1:0>: mask source for filter 2 bit (same values as bit 15-14) bit 3-2 f1msk<1:0>: mask source for filter 1 bit (same values as bit 15-14) bit 1-0 f0msk<1:0>: mask source for filter 0 bit (same values as bit 15-14)
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 296 preliminary ? 2011 microchip technology inc. register 21-19: cifmsksel2: ecan? filter 15-8 mask selection register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 f15msk<1:0> f14msk<1:0> f13msk<1:0> f12msk<1:0> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 f11msk<1:0> f10msk<1:0> f9msk<1:0> f8msk<1:0> bit 7 bit 0 legend: c = writable bit, but only ?0? can be written to clear the bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-14 f15msk<1:0>: mask source for filter 15 bit 11 = reserved 10 = acceptance mask 2 registers contain mask 01 = acceptance mask 1 registers contain mask 00 = acceptance mask 0 registers contain mask bit 13-12 f14msk<1:0>: mask source for filter 14 bit (same values as bit 15-14) bit 11-10 f13msk<1:0>: mask source for filter 13 bit (same values as bit 15-14) bit 9-8 f12msk<1:0>: mask source for filter 12 bit (same values as bit 15-14) bit 7-6 f11msk<1:0>: mask source for filter 11 bit (same values as bit 15-14) bit 5-4 f10msk<1:0>: mask source for filter 10 bit (same values as bit 15-14) bit 3-2 f9msk<1:0>: mask source for filter 9 bit (same values as bit 15-14) bit 1-0 f8msk<1:0>: mask source for filter 8 bit (same values as bit 15-14)
? 2011 microchip technology inc. preliminary ds70657d-page 297 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 21-20: cirxmnsid: ecan? acceptance filter mask standard identifier register n (n = 0-2) r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x sid10 sid9 sid8 sid7 sid6 sid5 sid4 sid3 bit 15 bit 8 r/w-x r/w-x r/w-x u-0 r/w-x u-0 r/w-x r/w-x sid2 sid1 sid0 ?mide ?eid17eid16 bit 7 bit 0 legend: c = writable bit, but only ?0? can be written to clear the bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-5 sid<10:0>: standard identifier bits 1 = include bit sidx in filter comparison 0 = bit sidx is don?t care in filter comparison bit 4 unimplemented: read as ? 0 ? bit 3 mide: identifier receive mode bit 1 = match only message types (standard or extended address) that correspond to exide bit in filter 0 = match either standard or extended address message if filters match (i.e., if (filter sid) = (me ssage sid) or if (filter si d/eid) = (message sid/eid)) bit 2 unimplemented: read as ? 0 ? bit 1-0 eid<17:16>: extended identifier bits 1 = include bit eidx in filter comparison 0 = bit eidx is don?t care in filter comparison register 21-21: cirxmneid: ecan? acceptance filter mask extended identifier register n (n = 0-2) r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x eid15 eid14 eid13 eid12 eid11 eid10 eid9 eid8 bit 15 bit 8 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x eid7 eid6 eid5 eid4 eid3 eid2 eid1 eid0 bit 7 bit 0 legend: c = writable bit, but only ?0? can be written to clear the bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 eid<15:0>: extended identifier bits 1 = include bit eidx in filter comparison 0 = bit eidx is don?t care in filter comparison
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 298 preliminary ? 2011 microchip technology inc. register 21-22: cirx ful1: ecan? receive buffer full register 1 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 rxful15 rxful14 rxful13 rxful12 rxful11 rxful10 rxful9 rxful8 bit 15 bit 8 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 rxful7 rxful6 rxful5 rxful4 rxful3 rxful2 rxful1 rxful0 bit 7 bit 0 legend: c = writable bit, but only ?0? can be written to clear the bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 rxful<15:0>: receive buffer n full bits 1 = buffer is full (set by module) 0 = buffer is empty (cleared by user software) register 21-23: cirx ful2: ecan? receive buffer full register 2 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 rxful31 rxful30 rxful29 rxful28 rxful27 rxful26 rxful25 rxful24 bit 15 bit 8 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 rxful23 rxful22 rxful21 rxful20 rxful19 rxful18 rxful17 rxful16 bit 7 bit 0 legend: c = writable bit, but only ?0? can be written to clear the bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 rxful<31:16>: receive buffer n full bits 1 = buffer is full (set by module) 0 = buffer is empty (cleared by user software)
? 2011 microchip technology inc. preliminary ds70657d-page 299 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 21-24: cirxovf1: ecan? re ceive buffer overflow register 1 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 rxovf15 rxovf14 rxovf13 rxovf12 rxovf11 rxovf10 rxovf9 rxovf8 bit 15 bit 8 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 rxovf7 rxovf6 rxovf5 rxovf4 rxovf3 rxovf2 rxovf1 rxovf0 bit 7 bit 0 legend: c = writable bit, but only ?0? can be written to clear the bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 rxovf<15:0>: receive buffer n overflow bits 1 = module attempted to write to a full buffer (set by module) 0 = no overflow condition (cleared by user software) register 21-25: cirxovf2: ecan? re ceive buffer overflow register 2 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 rxovf31 rxovf30 rxovf29 rxovf28 rxovf27 rxovf26 rxovf25 rxovf24 bit 15 bit 8 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 r/c-0 rxovf23 rxovf22 rxovf21 rxovf20 rxovf19 rxovf18 rxovf17 rxovf16 bit 7 bit 0 legend: c = writable bit, but only ?0? can be written to clear the bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 rxovf<31:16>: receive buffer n overflow bits 1 = module attempted to write to a full buffer (set by module) 0 = no overflow condition (cleared by user software)
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 300 preliminary ? 2011 microchip technology inc. register 21-26: citrmncon: ecan? tx/rx buffer m control register (m = 0,2,4,6; n = 1,3,5,7) r/w-0 r-0 r-0 r-0 r/w-0 r/w-0 r/w-0 r/w-0 txenn txabtn txlarbn txerrn txreqn rtrenn txnpri<1:0> bit 15 bit 8 r/w-0 r-0 r-0 r-0 r/w-0 r/w-0 r/w-0 r/w-0 txenm txabtm (1) txlarbm (1) txerrm (1) txreqm rtrenm txmpri<1:0> bit 7 bit 0 legend: c = writable bit, but only ?0? can be written to clear the bit r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-8 see definition for bits 7-0, controls buffer n bit 7 txenm: tx/rx buffer selection bit 1 = buffer trbn is a transmit buffer 0 = buffer trbn is a receive buffer bit 6 txabtm: message aborted bit (1) 1 = message was aborted 0 = message completed transmission successfully bit 5 txlarbm: message lost arbitration bit (1) 1 = message lost arbitration while being sent 0 = message did not lose arbitration while being sent bit 4 txerrm: error detected during transmission bit (1) 1 = a bus error occurred while the message was being sent 0 = a bus error did not occur while the message was being sent bit 3 txreqm: message send request bit 1 = requests that a message be sent. the bit automa tically clears when the message is successfully sent. 0 = clearing the bit to ? 0 ? while set requests a message abort. bit 2 rtrenm: auto-remote transmit enable bit 1 = when a remote transmit is received, txreq will be set 0 = when a remote transmit is received, txreq will be unaffected bit 1-0 txmpri<1:0>: message transmission priority bits 11 = highest message priority 10 = high intermediate message priority 01 = low intermediate message priority 00 = lowest message priority note 1: this bit is cleared when txreq is set. note: the buffers, sid, eid, dlc, data field and re ceive status registers are located in dma ram.
? 2011 microchip technology inc. preliminary ds70657d-page 301 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 21.5 ecan message buffers ecan message buffers are part of ram memory. they are not ecan special function registers. the user application must directly write into the ram area that is configured for ecan message buffers. the location and size of the buffer area is defined by the user application. buffer 21-1: ecan? message buffer word 0 u-0 u-0 u-0 r/w-x r/w-x r/w-x r/w-x r/w-x ? ? ? sid10 sid9 sid8 sid7 sid6 bit 15 bit 8 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x sid5 sid4 sid3 sid2 sid1 sid0 srr ide bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-13 unimplemented: read as ? 0 ? bit 12-2 sid<10:0>: standard identifier bits bit 1 srr: substitute remote request bit when txide = 0 : 1 = message will request remote transmission 0 = normal message when txide = 1 : the srr bit must be set to ? 1 ? bit 0 ide: extended identifier bit 1 = message will transmit extended identifier 0 = message will transmit standard identifier buffer 21-2: ecan? message buffer word 1 u-0 u-0 u-0 u-0 r/w-x r/w-x r/w-x r/w-x ? ? ? ?eid17eid16eid15eid14 bit 15 bit 8 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x eid13 eid12 eid11 eid10 eid9 eid8 eid7 eid6 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-12 unimplemented: read as ? 0 ? bit 11-0 eid<17:6>: extended identifier bits
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 302 preliminary ? 2011 microchip technology inc. ( buffer 21-3: ecan? message buffer word 2 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x eid5 eid4 eid3 eid2 eid1 eid0 rtr rb1 bit 15 bit 8 u-x u-x u-x r/w-x r/w-x r/w-x r/w-x r/w-x ? ? ? rb0 dlc3 dlc2 dlc1 dlc0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-10 eid<5:0>: extended identifier bits bit 9 rtr: remote transmission request bit when txide = 1 : 1 = message will request remote transmission 0 = normal message when txide = 0 : the rtr bit is ignored. bit 8 rb1: reserved bit 1 user must set this bit to ? 0 ? per can protocol. bit 7-5 unimplemented: read as ? 0 ? bit 4 rb0: reserved bit 0 user must set this bit to ? 0 ? per can protocol. bit 3-0 dlc<3:0>: data length code bits buffer 21-4: ecan ? message buffer word 3 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x byte 1 bit 15 bit 8 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x byte 0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-8 byte 1<15:8>: ecan? message byte 0 bit 7-0 byte 0<7:0>: ecan message byte 1
? 2011 microchip technology inc. preliminary ds70657d-page 303 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x buffer 21-5: ecan ? message buffer word 4 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x byte 3 bit 15 bit 8 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x byte 2 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-8 byte 3<15:8>: ecan? message byte 3 bit 7-0 byte 2<7:0>: ecan message byte 2 buffer 21-6: ecan ? message buffer word 5 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x byte 5 bit 15 bit 8 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x byte 4 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-8 byte 5<15:8>: ecan? message byte 5 bit 7-0 byte 4<7:0>: ecan message byte 4
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 304 preliminary ? 2011 microchip technology inc. buffer 21-7: ecan ? message buffer word 6 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x byte 7 bit 15 bit 8 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x byte 6 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-8 byte 7<15:8>: ecan? message byte 7 bit 7-0 byte 6<7:0>: ecan message byte 6 buffer 21-8: ecan? message buffer word 7 u-0 u-0 u-0 r/w-x r/w-x r/w-x r/w-x r/w-x ? ? ? filhit<4:0> (1) bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-13 unimplemented: read as ? 0 ? bit 12-8 filhit<4:0>: filter hit code bits (1) encodes number of filter that resulted in writing this buffer. bit 7-0 unimplemented: read as ? 0 ? note 1: only written by module for receive buffers, unused for transmit buffers.
? 2011 microchip technology inc. preliminary ds70657d-page 305 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 22.0 charge time measurement unit (ctmu) the charge time measurement unit is a flexible ana- log module that provides accurate differential time measurement between pulse sources, as well as asynchronous pulse generation. its key features include: ? four edge input trigger sources ? polarity control for each edge source ? control of edge sequence ? control of response to edges ? precise time measurement resolution of 1 ns ? accurate current source suitable for capacitive measurement ? on-chip temperature measurement using a built-in diode together with other on-chip analog modules, the ctmu can be used to precisely measure time, measure capacitance, measure relative changes in capacitance or generate output pulses that are independent of the system clock. the ctmu module is ideal for interfacing with capaci- tive-based sensors.the ct mu is controlled through two registers: ctmucon and ctmuicon. ctmucon enables the module and controls edge source selection, edge sour ce polarity selection and edge sequencing. the ctmuicon register controls the selection and trim of the current source. figure 22-1: ctmu block diagram note 1: this data sheet summarizes the fea- tures of the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x family of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to section 33. ?charge time measurement unit (ctmu)? (ds70661) in the ? dspic33e/pic24e family reference manual? , which is available on the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for de vice-specific register and bit information. cted1 cted2 current source edge control logic ctmucon1 or ctmucon2 pulse generator ctmui to adc cmp1 timer1 oc1 current control itrim<5:0> irng<1:0> ctmuicon ctmu control logic edg1stat edg2stat analog-to-digital ctpls ic1 cmp1 c1in1- cdelay ctmu temp ctmu temperature sensor current control selection tgen edg1stat, edg2stat ctmu temp 0 edg1stat = edg2stat ctmui to adc 0 edg1stat edg2stat ctmup 1 edg1stat edg2stat no connect 1 edg1stat = edg2stat trigger tgen ctmup external capacitor for pulse generation
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 306 preliminary ? 2011 microchip technology inc. 22.1 ctmu resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 22.1.1 key resources ? section 33. ?charge time measurement unit (ctmu)? (ds70661) ? code samples ? application notes ? software libraries ? webinars ? all related dspic33e/pic24e family reference manuals sections ? development tools note: in the event you are not able to access the product page using t he link above, enter this url in your browser: http://www.microchip.com/wwwprod- ucts/devices.aspx?ddoc- name=en555464
? 2011 microchip technology inc. preliminary ds70657d-page 307 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 22.2 ctmu control registers register 22-1: ctmucon1: ct mu control register 1 r/w-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ctmuen ? ctmusidl tgen edgen edgseqen idissen (1) cttrig bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 ctmuen: ctmu enable bit 1 = module is enabled 0 = module is disabled bit 14 unimplemented: read as ? 0 ? bit 13 ctmusidl: stop in idle mode bit 1 = discontinue module operation when device enters idle mode 0 = continue module operation in idle mode bit 12 tgen: time generation enable bit 1 = enables edge delay generation 0 = disables edge delay generation bit 11 edgen: edge enable bit 1 = hardware modules are used to trigger edges (tmrx, ctedx, etc.) 0 = software is used to trigger edges (manual set of edgxstat) bit 10 edgseqen: edge sequence enable bit 1 = edge 1 event must occur before edge 2 event can occur 0 = no edge sequence is needed bit 9 idissen: analog current source control bit (1) 1 = analog current source output is grounded 0 = analog current source output is not grounded bit 8 cttrig: adc trigger control bit 1 = ctmu triggers adc start of conversion 0 = ctmu does not trigger adc start of conversion bit 7-0 unimplemented: read as ? 0 ? note 1: the adc module sample and hold capacitor is not automatically discharged between sample/conversion cycles. software using the adc as pa rt of a capacitance measurement, must discharge the adc capacitor before conducting the measurement . the idissen bit, when set to ? 1 ?, performs this function. the adc must be sampling while the idissen bit is active to connect th e discharge sink to the capacitor array.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 308 preliminary ? 2011 microchip technology inc. register 22-2: ctmucon2: ct mu control register 2 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 edg1mod edg1pol edg1sel<3 :0> edg2stat edg1stat bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 u-0 u-0 edg2mod edg2pol edg2sel<3:0> ? ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 edg1mod: edge 1 edge sampling mode selection bit 1 = edge 1 is edge sensitive 0 = edge 1 is level sensitive bit 14 edg1pol: edge 1 polarity select bit 1 = edge 1 programmed for a positive edge response 0 = edge 1 programmed for a negative edge response bit 13-10 edg1sel<3:0>: edge 1 source select bits 1xxx = reserved 01xx = reserved 0011 = cted1 pin 0010 = cted2 pin 0001 = oc1 module 0000 = timer1 module bit 9 edg2stat: edge 2 status bit indicates the status of edge 2 and can be written to control the edge source. 1 = edge 2 has occurred 0 = edge 2 has not occurred bit 8 edg1stat: edge 1 status bit indicates the status of edge 1 and can be written to control the edge source. 1 = edge 1 has occurred 0 = edge 1 has not occurred bit 7 edg2mod: edge 2 edge sampling mode selection bit 1 = edge 2 is edge sensitive 0 = edge 2 is level sensitive bit 6 edg2pol: edge 2 polarity select bit 1 = edge 2 programmed for a positive edge response 0 = edge 2 programmed for a negative edge response bit 5-2 edg2sel<3:0>: edge 2 source select bits 1111 = reserved 01xx = reserved 0100 = cmp1 module 0011 = cted2 pin 0010 = cted1 pin 0001 = oc1 module 0000 = ic1 module bit 1-0 unimplemented: read as ? 0 ?
? 2011 microchip technology inc. preliminary ds70657d-page 309 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 22-3: ctmuicon: ct mu current control register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 itrim<5:0> irng<1:0> bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-10 itrim<5:0>: current source trim bits 011111 = maximum positive change from nominal current +62% 011110 = maximum positive change from nominal current +60% ? ? ? 000010 = minimum positive change from nominal current +4% 000001 = minimum positive change from nominal current +2% 000000 = nominal current output specified by irng<1:0> 111111 = minimum negative change from nominal current -2% 111110 = minimum negative change from nominal current -4% ? ? ? 100010 = maximum negative change from nominal current -60% 100001 = maximum negative change from nominal current -62% bit 9-8 irng<1:0>: current source range select bits 11 = 100 base current (2) 10 = 10 base current (2) 01 = base current level (2) 00 = 1000 base current (1,2) bit 7-0 unimplemented: read as ? 0 ? note 1: this current range is not available to be used with the internal temperature measurement diode. 2: refer to the ctmu current source specifications ( table 30-55 ) in section 30.0 ?electrical characteristics? for the current range selection values.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 310 preliminary ? 2011 microchip technology inc. notes:
? 2011 microchip technology inc. preliminary ds70657d-page 311 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 23.0 10-bit/12-bit analog-to- digital con verter (adc) the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/ 50x, and pic24epxxxgp/mc 20x devices have one adc module. the adc module supports up to 16 analog input channels. on adc1, the ad12b bit (ad1con1<10>) allows each of the adc modules to be configured by the user as either a 10-bit, 4-sample/hold adc (default configuration) or a 12-bi t, 1-sample/hold adc. 23.1 key features the 10-bit adc configuration has the following key features: ? successive approximation (sar) conversion ? conversion speeds of up to 1.1 msps ? up to 16 analog input pins ? external voltage reference input pins ? simultaneous sampling of up to four analog input pins ? automatic channel scan mode ? selectable conversion trigger source ? selectable buffer fill modes ? four result alignment opt ions (signed/unsigned, fractional/integer) ? operation during cpu sleep and idle modes the 12-bit adc configurat ion supports all the above features, except: ? in the 12-bit configurati on, conversion speeds of up to 500 ksps are supported ? there is only one sample/hold amplifier in the 12-bit configuration, so simultaneous sampling of multiple channels is not supported. depending on the particular device pinout, the adc can have up to 16 analog input pins, designated an0 through an15. in addition, there are two analog input pins for external voltage reference connections. these voltage reference inputs can be shared with other ana- log input pins. the actual number of analog input pins and external voltage reference input configuration depends on the specific device. a block diagram of the adc module is shown in figure 23-1 . figure 23-2 provides a diagram of the adc conversion clock period. note 1: this data sheet summ arizes the features of the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x families of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to section 16. ?analog-to- digital converter (adc)? (ds70621) of the ? dspic33e/pic24e family refer- ence manual ?, which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for de vice-specific register and bit information. note: the adc module needs to be disabled before modifying the ad12b bit.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 312 preliminary ? 2011 microchip technology inc. figure 23-1: adc module block diagram s&h0 s&h1 an0 any (3) an1 v refl ch0sb<4:0> (5) ch0na (5) ch0nb (5) + - an0 oa1 ch123sa an9 v refl ch123sb ch123na ch123nb an6 + - s&h2 an1 oa2 ch123sa an10 v refl ch123sb ch123na ch123nb an7 + - s&h3 an2 oa3 ch123sa an11 v refl ch123sb ch123na ch123nb an8 + - ch1 (2) ch0 ch2 (2) ch3 (2) ch0sa<4:0> (5) channel scan cscna alternate input selection note 1: v ref +, v ref - inputs can be multiplexed with other analog inputs. 2: channels 1, 2 and 3 are not applicable for the 12-bit mode of operation. 3: for 28-pin devices, y = 5; for 36-pin devices, y = 7; for 44-pin devices, y = 8; for 64-pin devices, y = 15. 4: this selection is only used with ct mu capacitive and time measurement. 5: these bits can be updated with step commands from the ptg module. see section 24.0 ?peripheral trigger generator (ptg) module? for more information. 6: when addmaen (adxcon4<8>) = 1 enabling dma, only adcxbuf0 is used. v ref + (1) av dd av ss v ref - (1) vcfg<2:0> sar adc adc1buf0 (6) adc1buf1 (6) adc1buf2 (6) adc1buff (6) adc1bufe (6) v refh v refl oa1 oa2 oa3 ctmu temp open (4) from ctmu current source (ctmui) ch0nb (5) ch0sb (5)
? 2011 microchip technology inc. preliminary ds70657d-page 313 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x figure 23-2: adc conversion clock period block diagram 1 0 adc internal rc clock (2) adc conversion clock multiplier 1, 2, 3, 4, 5,..., 64 ad1con3<15> t p (1) t ad 6 ad1con3<7:0> note 1: t p = 1/f p . 2: see the adc electrical characterist ics for the exact rc clock value.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 314 preliminary ? 2011 microchip technology inc. 23.2 adc helpful tips 1. the smpi control bits in the adxcon2 registers: a) determine when the adc interrupt flag is set and an interrupt is generated, if enabled. b) when the cscna bit in the adxcon2 reg- isters is set to ? 1 ?, this determines when the adc analog scan channel list defined in the ad1cssl/ad1cssh registers starts over from the beginning. c) when the dma peripheral is not used (addmaen = 0 ), this determines when the adc result buffer pointer to adc1buf0- adc1buff, gets reset back to the beginning at adc1buf0. d) when the dma peripheral is used (addmaen = 1 ), this determines when the dma address pointer is incremented after a sample/conversion operation. adc1buf0 is the only adc buffer used in this mode. the adc result buffer pointer to adc1buf0-adc1buff gets reset back to the beginning at adc1buf0. the dma address is incremented after completion of every 32nd sample/conversion operation. conversion results are stored in the adc1buf0 register for transfer to ram using dma. 2. when the dma module is disabled (addmaen = 0 ), the adc has 16 result buffers. adc conversion results are stored sequentially in adc1buf0-adc1buff regardless of which analog inputs are being used subject to the smpi bits and the condition described in 1c above. there is no relationship between the anx input being measured and which adc buf- fer (adc1buf0-adc1buff) that the conversion results will be placed in. 3. when the dma module is enabled (addmaen = 1 ), the adc module has only 1 adc result buffer, (i.e., adc1buf0), per adc peripheral and the adc conversion result must be read either by the cpu or dma controller before the next adc conversion is complete to avoid overwriting the previous value. 4. the done bit (adxcon1<0>) is only cleared at the start of each conversion and is set at the completion of the conv ersion, but remains set indefinitely even through the next sample phase until the next conversion begins. if application code is monitoring the done bit in any kind of software loop, the user must consider this behavior because the cpu code execution is faster than the adc. as a result, in manual sam- ple mode, particularly where the users code is setting the samp bit (adxcon1<1>), the done bit should also be cleared by the user application just before setting the samp bit. 23.3 adc resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 23.3.1 key resources ? section 4. ?analog-to-digital converter (adc)? (ds70621) ? code samples ? application notes ? software libraries ? webinars ? all related dspic33e/pic24e family reference manuals sections ? development tools note: in the event you are not able to access the product page using the link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
? 2011 microchip technology inc. preliminary ds70657d-page 315 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 23.4 adc control registers register 23-1: ad1con1: adc1 control register 1 r/w-0 u-0 r/w-0 r/w-0 u-0 r/w-0 r/w-0 r/w-0 adon ?adsidladdmabm ? ad12b form<1:0> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 hc,hs r/c-0 hc, hs ssrc<2:0> ssrcg simsam asam samp done (3) bit 7 bit 0 legend: hc = cleared by hardware hs = set by hardware r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 adon: adc operating mode bit 1 = adc module is operating 0 = adc is off bit 14 unimplemented: read as ? 0 ? bit 13 adsidl: stop in idle mode bit 1 = discontinue module operation when device enters idle mode 0 = continue module operation in idle mode bit 12 addmabm: dma buffer build mode bit 1 = dma buffers are written in the order of conver sion. the module provides an address to the dma channel that is the same as the address used for the non-dma stand-alone buffer. 0 = dma buffers are written in scatter/gather mo de. the module provides a scatter/gather address to the dma channel, based on the index of t he analog input and the size of the dma buffer. bit 11 unimplemented: read as ? 0 ? bit 10 ad12b: 10-bit or 12-bit operation mode bit 1 = 12-bit, 1-channel adc operation 0 = 10-bit, 4-channel adc operation bit 9-8 form<1:0>: data output format bits for 10-bit operation: 11 = signed fractional (d out = sddd dddd dd00 0000 , where s = .not.d<9>) 10 = fractional (d out = dddd dddd dd00 0000 ) 01 = signed integer (d out = ssss sssd dddd dddd , where s = .not.d<9>) 00 = integer (d out = 0000 00dd dddd dddd ) for 12-bit operation: 11 = signed fractional (d out = sddd dddd dddd 0000 , where s = .not.d<11>) 10 = fractional (d out = dddd dddd dddd 0000 ) 01 = signed integer (d out = ssss sddd dddd dddd , where s = .not.d<11>) 00 = integer (d out = 0000 dddd dddd dddd ) note 1: see section 24.0 ?peripheral trigger generator (ptg) module? for information on this selection. 2: this setting is available in dspic33epxxxm c20x/50x and pic24epxxxm c20x devices only. 3: do not clear the done bi t in software if auto-s ample is enabled (asam = 1 ).
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 316 preliminary ? 2011 microchip technology inc. bit 7-5 ssrc<2:0>: sample clock source select bits if ssrcg = 1 : 111 = reserved 110 = ptgo15 primary trigger compare ends sampling and starts conversion (1) 101 = ptgo14 primary trigger compare ends sampling and starts conversion (1) 100 = ptgo13 primary trigger compare ends sampling and starts conversion (1) 011 = ptgo12 primary trigger compare ends sampling and starts conversion (1) 010 = pwm generator 3 primary trigger compare ends sampling and starts conversion (2) 001 = pwm generator 2 primary trigger compare ends sampling and starts conversion (2) 000 = pwm generator 1 primary trigger compare ends sampling and starts conversion (2) if ssrcg = 0 : 111 = internal counter ends sampling a nd starts conversion (auto-convert) 110 = ctmu ends sampling and starts conversion 101 = reserved 100 = timer5 compare ends sampling and starts conversion 011 = pwm primary special event trigger ends sampling and starts conversion (2) 010 = timer3 compare ends sampling and starts conversion 001 = active transition on the int0 pin ends sampling and starts conversion 000 = clearing the sample bit (samp) ends sampling and starts conversion (manual mode) bit 4 ssrcg: sample clock source group bit see ssrc<2:0> for details. bit 3 simsam: simultaneous sample select bit (only applicable when chps<1:0> = 01 or 1x ) when ad12b = 1 , simsam is: u-0, unimplemented, read as ? 0 ? 1 = samples ch0, ch1, ch2, ch3 simultaneously (when chps<1:0> = 1x ); or samples ch0 and ch1 simultaneously (when chps<1:0> = 01 ) 0 = samples multiple channels individually in sequence bit 2 asam: adc sample auto-start bit 1 = sampling begins immediately after last conversion. samp bit is auto-set. 0 = sampling begins when samp bit is set bit 1 samp: adc sample enable bit 1 = adc sample/hold amplifiers are sampling 0 = adc sample/hold amplifiers are holding if asam = 0 , software can write ? 1 ? to begin sampling. automatically set by hardware if asam = 1 . if ssrc = 000 , software can write ? 0 ? to end sampling and start conversion. if ssrc 000 , automatically cleared by hardware to end sampling and start conversion. bit 0 done: adc conversion status bit (3) 1 = adc conversion cycle is completed. 0 = adc conversion not started or in progress automatically set by hardware when a/d conversion is complete. software can write ? 0 ? to clear done status (software not allowed to write ? 1 ?). clearing this bit does not affect any operation in progress. automatically cleared by hardware at start of a new conversion. register 23-1: ad1con1: adc1 control register 1 (continued) note 1: see section 24.0 ?peripheral trigger generator (ptg) module? for information on this selection. 2: this setting is available in dspic33epxxxm c20x/50x and pic24epxxxmc20x devices only. 3: do not clear the done bit in software if auto-sample is enabled (asam = 1 ).
? 2011 microchip technology inc. preliminary ds70657d-page 317 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 23-2: ad1con2: adc1 control register 2 r/w-0 r/w-0 r/w-0 u-0 u-0 r/w-0 r/w-0 r/w-0 vcfg<2:0> ? ? cscna chps<1:0> bit 15 bit 8 r-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 bufs smpi<4:0> bufm alts bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-13 vcfg<2:0>: converter voltage reference configuration bits bit 12-11 unimplemented: read as ? 0 ? bit 10 cscna: input scan select bit 1 = scan inputs for ch0+ during sample a bit 0 = do not scan inputs bit 9-8 chps<1:0>: channel select bits when ad12b = 1 , chps<1:0> is: u-0, un implemented, read as ? 0 ? 1x = converts ch0, ch1, ch2 and ch3 01 = converts ch0 and ch1 00 = converts ch0 bit 7 bufs: buffer fill status bit (only valid when bufm = 1 ) 1 = adc is currently filling the sec ond half of the buffer. the user application should access data in the first half of the buffer 0 = adc is currently filling the first half of the buffer. t he user application should access data in the second half of the buffer. bit 6-2 smpi<4:0>: increment rate bits when addmaen = 0 : x1111 = generates interrupt after completion of every 16th sample/conversion operation x1110 = generates interrupt after completion of every 15th sample/conversion operation ? ? ? x0001 = generates interrupt afte r completion of every 2nd sample/conversion operation x0000 = generates interrupt after completion of every sample/conversion operation when addmaen = 1 : 11111 = increments the dma address after completi on of every 32nd sample/conversion operation 11110 = increments the dma address after completi on of every 31st sample/conversion operation ? ? ? 00001 = increments the dma address after completi on of every 2nd sample/conversion operation 00000 = increments the dma address after comp letion of every sample/conversion operation v refh v refl 000 a vdd avss 001 external v ref + avss 010 a vdd external v ref - 011 external v ref + external v ref - 1xx a vdd avss
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 318 preliminary ? 2011 microchip technology inc. bit 1 bufm: buffer fill mode select bit 1 = starts buffer filling the first half of the buffer on the first interrupt and the second half of the buffer on next interrupt 0 = always starts filling the buffer from the start address. bit 0 alts: alternate input sample mode select bit 1 = uses channel input selects for sample a on first sample and sample b on next sample 0 = always uses channel input selects for sample a register 23-2: ad1con2: adc1 control register 2 (continued)
? 2011 microchip technology inc. preliminary ds70657d-page 319 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 23-3: ad1con3: adc1 control register 3 r/w-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 adrc ? ? samc<4:0> (1) bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 adcs<7:0> (2) bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 adrc: adc conversion clock source bit 1 = adc internal rc clock 0 = clock derived from system clock bit 14-13 unimplemented: read as ? 0 ? bit 12-8 samc<4:0>: auto sample time bits (1) 11111 = 31 t ad ? ? ? 00001 = 1 t ad 00000 = 0 t ad bit 7-0 adcs<7:0>: adc conversion clock select bits (2) 11111111 = t p (adcs<7:0> + 1) = t p 256 = t ad ? ? ? 00000010 = t p (adcs<7:0> + 1) = t p 3 = t ad 00000001 = t p (adcs<7:0> + 1) = t p 2 = t ad 00000000 = t p (adcs<7:0> + 1) = t p 1 = t ad note 1: this bit is only used if ad1con1<7:5> (ssrc<2:0>) = 111 and ad1con1<4> (ssrcg) = 0 . 2: this bit is not used if ad1con3<15> (adrc) = 1 .
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 320 preliminary ? 2011 microchip technology inc. register 23-4: ad1con4: adc1 control register 4 u-0 u-0 u-0 u-0 u-0 u-0 u-0 r/w-0 ? ? ? ? ? ? ? addmaen bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 ? ? ? ? ? dmabl<2:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-7 unimplemented: read as ? 0 ? bit 8 addmaen: adc dma enable bit 1 = conversion results stored in adc1buf0 register, for transfer to ram using dma 0 = conversion results stored in adc1buf0 through adc1buff registers; dma will not be used bit 7-3 unimplemented: read as ? 0 ? bit 2-0 dmabl<2:0>: selects number of dma buffer locations per analog input bits 111 = allocates 128 words of buffer to each analog input 110 = allocates 64 words of buffer to each analog input 101 = allocates 32 words of buffer to each analog input 100 = allocates 16 words of buffer to each analog input 011 = allocates 8 words of buffer to each analog input 010 = allocates 4 words of buffer to each analog input 001 = allocates 2 words of buffer to each analog input 000 = allocates 1 word of buffer to each analog input
? 2011 microchip technology inc. preliminary ds70657d-page 321 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 23-5: ad1chs123: adc1 in put channel 1, 2, 3 select register u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 ? ? ? ? ? ch123nb<1:0> ch123sb bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 ? ? ? ? ? ch123na<1:0> ch123sa bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-11 unimplemented: read as ? 0 ? bit 10-9 ch123nb<1:0>: channel 1, 2, 3 negative i nput select for sample b bits when ad12b = 1 , chxnb is: u-0, unimplemented, read as ? 0 ? 11 = ch1 negative input is an9, ch2 negative input is an10, ch3 negative input is an11 10 = ch1 negative input is an6, ch2 negative input is an7, ch3 negative input is an8 0x = ch1, ch2, ch3 negative input is v refl bit 8 ch123sb: channel 1, 2, 3 positive input select for sample b bit when ad12b = 1 , chxsa is: u-0, unimplemented, read as ? 0 ? 1 = ch1 positive input is oa1, ch2 positive input is oa2, ch3 positive input is oa3 0 = ch1 positive input is an0, ch2 positive input is an1, ch3 positive input is an2 bit 7-3 unimplemented: read as ? 0 ? bit 2-1 ch123na<1:0>: channel 1, 2, 3 negative i nput select for sample a bits when ad12b = 1 , chxna is: u-0, unimplemented, read as ? 0 ? 11 = ch1 negative input is an9, ch2 negative input is an10, ch3 negative input is an11 10 = ch1 negative input is an6, ch2 negative input is an7, ch3 negative input is an8 0x = ch1, ch2, ch3 negative input is v refl bit 0 ch123sa: channel 1, 2, 3 positive input select for sample a bit when ad12b = 1 , chxsa is: u-0, unimplemented, read as ? 0 ? 1 = ch1 positive input is oa1, ch2 positive input is oa2, ch3 positive input is oa3 0 = ch1 positive input is an0, ch2 positive input is an1, ch3 positive input is an2
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 322 preliminary ? 2011 microchip technology inc. register 23-6: ad1chs0: adc1 input channel 0 select register r/w-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ch0nb ? ? ch0sb<4:0> bit 15 bit 8 r/w-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ch0na ? ? ch0sa<4:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 ch0nb: channel 0 negative input select for sample b bit 1 = channel 0 negative input is an1 0 = channel 0 negative input is v refl bit 14-13 unimplemented: read as ? 0 ? bit 12-8 ch0sb<4:0>: channel 0 positive input select for sample b bits 11111 = open; use this selection with ctmu capacitive and time measurement 11110 = channel 0 positive input is connected to ctmu temperature measurement diode (ctmu temp) 11101 = reserved 11100 = reserved 11011 = reserved 11010 = channel 0 positive in put is output of cmp3 11001 = channel 0 positive in put is output of cmp2 11000 = channel 0 positive in put is output of cmp1 10110 = reserved ? ? ? 10000 = reserved 01111 = channel 0 positive input is an15 (1) 01110 = channel 0 positive input is an14 (1) 01101 = channel 0 positive input is an13 (1) ? ? ? 00010 = channel 0 positive input is an2 (1) 00001 = channel 0 positive input is an1 (1) 00000 = channel 0 positive input is an0 (1) bit 7 ch0na: channel 0 negative input select for sample a bit 1 = channel 0 negative input is an1 0 = channel 0 negative input is v refl bit 6-5 unimplemented: read as ? 0 ? note 1: see the ?pin diagrams? section for the available analog channels for each device.
? 2011 microchip technology inc. preliminary ds70657d-page 323 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x bit 4-0 ch0sa<4:0>: channel 0 positive input select for sample a bits 11111 = open; use this selection with ctmu capacitive and time measurement 11110 = channel 0 positive input is connected to ctmu temperature measurement diode (ctmu temp) 11101 = reserved 11100 = reserved 11011 = reserved 11010 = channel 0 positive in put is output of cmp3 11001 = channel 0 positive in put is output of cmp2 11000 = channel 0 positive in put is output of cmp1 10110 = reserved ? ? ? 10000 = reserved 01111 = channel 0 positive input is an15 (1) 01110 = channel 0 positive input is an14 (1) 01101 = channel 0 positive input is an13 (1) ? ? ? 00010 = channel 0 positive input is an2 (1) 00001 = channel 0 positive input is an1 (1) 00000 = channel 0 positive input is an0 (1) register 23-6: ad1chs0: adc1 input channel 0 select register note 1: see the ?pin diagrams? section for the available analog channels for each device.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 324 preliminary ? 2011 microchip technology inc. register 23-7: ad1cssh: adc1 input scan select register high (1) r/w-0 r/w-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 css31 css30 ? ? ? css26 css25 css24 bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 css31: adc input scan selection bits 1 = select ctmu capacitive and time measurement for input scan (open) 0 = skip ctmu capacitive and time measurement for input scan (open) bit 14 css30: adc input scan selection bits 1 = select ctmu on-chip temperature measurement for input scan (ctmu temp) 0 = skip ctmu on-chip temperature measurement for input scan (ctmu temp) bit 13-11 unimplemented: read as ? 0 ? bit 10 css26: adc input scan selection bits 1 = select cmp3 for input scan 0 = skip cmp3 for input scan bit 9 css25: adc input scan selection bits 1 = select cmp2 for input scan 0 = skip cmp2 for input scan bit 8 css24: adc input scan selection bits 1 = select cmp1 for input scan 0 = skip cmp1 for input scan bit 7-0 unimplemented: read as ? 0 ? note 1: all adxcssh bits can be selected by user software. however, inputs selected for scan without a corresponding input on device convert v refl .
? 2011 microchip technology inc. preliminary ds70657d-page 325 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 23-8: ad1cssl: adc1 in put scan select register low (1,2) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 css15 css14 css13 css12 css11 css10 css9 css8 bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 css7 css6 css5 css4 css3 css2 css1 css0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 css<15:0>: adc input scan selection bits 1 = select anx for input scan 0 = skip anx for input scan note 1: on devices with less than 16 analog inputs, all ad1cssl bits can be selected by the user. however, inputs selected for scan without a corresponding input on device convert v refl . 2: cssx = anx, where x = 0-15.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 326 preliminary ? 2011 microchip technology inc. notes:
? 2011 microchip technology inc. preliminary ds70657d-page 327 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 24.0 peripheral trigger generator (ptg) module 24.1 module introduction the peripheral trigger gener ator (ptg) provides a means to schedule complex high-speed peripheral operations that would be difficult to achieve using soft- ware. the ptg module uses 8-bit commands called ?steps? that the user writes to the ptg queue register (ptgque0-ptque7), which performs operations such as wait for input signal, generate output trigger, and wait for timer. the ptg module has the following major features: ? multiple clock sources ? two 16-bit general purpose timers ? two 16-bit general limit counters ? configurable for rising or falling edge triggering ? generates processor interrupts to include: - four configurable processor interrupts - interrupt on a step event in single-step mode - interrupt on a ptg watchdog timer time-out ? able to receive trigger signals from these peripherals: -adc -pwm - output compare - input capture - op amp/comparator -int2 ? able to trigger or synchronize to these peripherals: - watchdog timer - output compare - input capture -adc -pwm - op amp/comparator note 1: this data sheet summarizes the fea- tures of the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x families of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to ?section 32. periph- eral trigger generator (ptg)? (ds70669) of the ?dspic33e/pic24e family reference manual? , which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for de vice-specific register and bit information.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 328 preliminary ? 2011 microchip technology inc. figure 24-1: ptg block diagram 16-bit data bus ptgqptr<4:0> command decoder ptghold ptgadj ptg watchdog timer (1) ptg control logic ptgwdtif ptg general purpose timer x ptg loop counter x clock inputs f p t ad t1clk t2clk t3clk ptgclk<2:0> ptgl0<15:0> ptgtxlim<15:0> ptgcxlim<15:0> ptgbte<15:0> ptgo0 ptgsdlim<15:0> ptg step delay timer pwm oc1 oc2 ic1 cmpx adc int2 ptgque0 ptgque1 ptgque2 ptgque3 ptgque5 ptgque4 ptgque6 ptgque7 ptgcst<15:0> ptgcon<15:0> note 1: this is a dedicated watchdog timer for the ptg module and is independent of the device watchdog timer. ptg interrupts trigger outputs ad1chs0<15:0> step command step command ptgstepif trigger inputs ptgo31 ? ? ? ptg0if ptg3if ? ? ? step command step command f osc ptgdiv<4:0>
? 2011 microchip technology inc. preliminary ds70657d-page 329 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 24.2 ptg resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 24.2.1 key resources ? section 32. ?peripheral trigger generator? (ds70669) ? code samples ? application notes ? software libraries ? webinars ? all related dspic33e/pic24e family reference manuals sections ? development tools note: in the event you are not able to access the product page using t he link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 330 preliminary ? 2011 microchip technology inc. 24.3 ptg control registers register 24-1: ptgcst: ptg control/status register r/w-0 u-0 r/w-0 r/w-0 u-0 r/w-0 r/w-0 r/w-0 ptgen ? ptgsidl ptgtogl ?ptgswt (2) ptgssen ptgivis bit 15 bit 8 r/w-0 hs-0 u-0 u-0 u-0 u-0 r/w-0 ptgstrt ptgwdto ? ? ? ? ptgitm<1:0> (1) bit 7 bit 0 legend: hs = set by hardware r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 ptgen: module enable bit 1 = ptg module is enabled 0 = ptg module is disabled bit 14 unimplemented: read as ? 0 ? bit 13 ptgsidl: stop in idle mode bit 1 = discontinue module operation when device enters idle mode 0 = continue module operation in idle mode bit 12 ptgtogl: trig output toggle mode bit 1 = toggle state of the ptgox for each execution of the ptgtrig command 0 = each execution of ptgtrig command will generate a single ptgox pulse determined by value in ptgpwd bit 11 unimplemented: read as ? 0 ? bit 10 ptgswt: software trigger bit (2) 1 = trigger the ptg module 0 = no action (clearing this bit will have no effect) bit 9 ptgssen: enable single step 1 = enable single step mode 0 = disable single step mode bit 8 ptgivis: counter/timer visibility control bit 1 = reads of the ptgsdlim, ptgcxlim or ptgtxlim registers returns the current values of their corresponding counter/timer registers (ptgsd, ptgcx, ptgtx) 0 = reads of the ptgsdlim, ptgcxlim or ptgtxlim registers returns the value previously written to those limit registers bit 7 ptgstrt: start ptg sequencer bit 1 = start to sequentially execute commands (continuous mode) 0 = stop executing commands bit 6 ptgwdto: ptg watchdog timer time-out status bit 1 = ptg watchdog timer has timed out 0 = ptg watchdog timer has not timed out. bit 5-2 unimplemented: read as ? 0 ? note 1: these bit apply to the ptgwhi and ptgwlo commands only. 2: this bit is only used with the ptgctrl step command software trigger option.
? 2011 microchip technology inc. preliminary ds70657d-page 331 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x bit 1-0 ptgitm<1:0>: ptg input trigger command operating mode bits (1) 11 = single level detect with step delay not ex ecuted on exit of command (regardless of ptgctrl command) 10 = single level detect with step delay executed on exit of command 01 = continuous edge detect with st ep delay not executed on exit of command (regardless of ptgctrl command) 00 = continuous edge detect with step de lay executed on exit of command register 24-1: ptgcst: ptg control/status register (continued) note 1: these bit apply to the ptgwhi and ptgwlo commands only. 2: this bit is only used with the ptgctrl step command software trigger option.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 332 preliminary ? 2011 microchip technology inc. register 24-2: ptgcon: ptg control register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ptgclk<2:0> ptgdiv<4:0> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ptgpwd<3:0> ?ptgwdt<2:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-13 ptgclk<2:0>: select ptg module clock source bits 111 = reserved 110 = reserved 101 = ptg module clock source will be t3clk 100 = ptg module clock source will be t2clk 011 = ptg module clock source will be t1clk 010 = ptg module clock source will be t ad 001 = ptg module clock source will be f osc 000 = ptg module clock source will be f p bit 12-8 ptgdiv<4:0>: ptg module clock pre scaler (divider) bits 11111 = divide by 32 11110 = divide by 31 ? ? ? 00001 = divide by 2 00000 = divide by 1 bit 7-4 ptgpwd<3:0>: ptg trigger output pulse width bits 1111 = all trigger outputs ar e 16 ptg clock cycles wide 1110 = all trigger outputs ar e 15 ptg clock cycles wide ? ? ? 0001 = all trigger outputs ar e 2 ptg clock cycles wide 0000 = all trigger outputs ar e 1 ptg clock cycle wide bit 3 unimplemented: read as ? 0 ? bit 2-0 ptgwdt<2:0>: select ptg watchdog time-out count value bits 111 = watchdog will time out after 512 ptg clocks 110 = watchdog will time out after 256 ptg clocks 101 = watchdog will time out after 128 ptg clocks 100 = watchdog will time out after 64 ptg clocks 011 = watchdog will time out after 32 ptg clocks 010 = watchdog will time out after 16 ptg clocks 001 = watchdog will time out after 8 ptg clocks 000 = watchdog is disabled
? 2011 microchip technology inc. preliminary ds70657d-page 333 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 24-3: ptgbte: ptg broadcast trigger enable register (1,2) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 adcts4 adcts3 adcts2 adcts1 ic4tss ic3tss ic2tss ic1tss bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 oc4cs oc3cs oc2cs oc1cs oc4tss oc3tss oc2tss oc1tss bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 adcts4: sample trigger ptgo15 for adc bit 1 = generate trigger when the broadcast command is executed 0 = do not generate trigger when the broadcast command is executed bit 14 adcts3: sample trigger ptgo14 for adc bit 1 = generate trigger when the broadcast command is executed 0 = do not generate trigger when the broadcast command is executed bit 13 adcts2: sample trigger ptgo13 for adc bit 1 = generate trigger when the broadcast command is executed 0 = do not generate trigger when the broadcast command is executed bit 12 adcts1: sample trigger ptgo12 for adc bit 1 = generate trigger when the broadcast command is executed 0 = do not generate trigger when the broadcast command is executed bit 11 ic4tss: trigger/synchronization source for ic4 bit 1 = generate trigger/synchronization w hen the broadcast command is executed 0 = do not generate trigger/synchronization when the broadcast command is executed bit 10 ic3tss: trigger/synchronization source for ic3 bit 1 = generate trigger/synchronization w hen the broadcast command is executed 0 = do not generate trigger/synchronization when the broadcast command is executed bit 9 ic2tss: trigger/synchronization source for ic2 bit 1 = generate trigger/synchronization w hen the broadcast command is executed 0 = do not generate trigger/synchronization when the broadcast command is executed bit 8 ic1tss: trigger/synchronization source for ic1 bit 1 = generate trigger/synchronization w hen the broadcast command is executed 0 = do not generate trigger/synchronization when the broadcast command is executed bit 7 oc4cs: clock source for oc4 bit 1 = generate clock pulse when t he broadcast command is executed 0 = do not generate clock pulse when the broadcast command is executed bit 6 oc3cs: clock source for oc3 bit 1 = generate clock pulse when t he broadcast command is executed 0 = do not generate clock pulse when the broadcast command is executed bit 5 oc2cs: clock source for oc2 bit 1 = generate clock pulse when t he broadcast command is executed 0 = do not generate clock pulse when the broadcast command is executed note 1: this register is read only when the ptg modu le is executing step commands (ptgen = 1 and ptgstrt = 1 ). 2: this register only used with the ptgctrl option = 1111 step command.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 334 preliminary ? 2011 microchip technology inc. bit 4 oc1cs: clock source for oc1 bit 1 = generate clock pulse when t he broadcast command is executed 0 = do not generate clock pulse when the broadcast command is executed bit 3 oc4tss: trigger/synchronization source for oc4 bit 1 = generate trigger/synchronization w hen the broadcast command is executed 0 = do not generate trigger/synchronizati on when the broadcast command is executed bit 2 oc3tss: trigger/synchronization source for oc3 bit 1 = generate trigger/synchronization w hen the broadcast command is executed 0 = do not generate trigger/synchronizati on when the broadcast command is executed bit 1 oc2tss: trigger/synchronization source for oc2 bit 1 = generate trigger/synchronization w hen the broadcast command is executed 0 = do not generate trigger/synchronizati on when the broadcast command is executed bit 0 oc1tss: trigger/synchronization source for oc1 bit 1 = generate trigger/synchronization w hen the broadcast command is executed 0 = do not generate trigger/synchronizati on when the broadcast command is executed register 24-3: ptgbte: ptg broadcast trigger enable register (1,2) (continued) note 1: this register is read only when the ptg mo dule is executing step commands (ptgen = 1 and ptgstrt = 1 ). 2: this register only used with the ptgctrl option = 1111 step command.
? 2011 microchip technology inc. preliminary ds70657d-page 335 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 24-4: ptgt0lim: ptg timer0 limit register (1) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ptgt0lim<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ptgt0lim<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 ptgt0lim<15:0>: ptg timer0 limit register bits general purpose timer0 limit re gister (effective only with a ptgt0 step command). note 1: this register is read only when the ptg modu le is executing step commands (ptgen = 1 and ptgstrt = 1 ). register 24-5: ptgt1lim: ptg timer1 limit register (1) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ptgt1lim<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ptgt1lim<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 ptgt1lim<15:0>: ptg timer1 limit register bits general purpose timer1 limit re gister (effective only with a ptgt1 step command). note 1: this register is read only when the ptg modu le is executing step commands (ptgen = 1 and ptgstrt = 1 ).
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 336 preliminary ? 2011 microchip technology inc. register 24-6: ptgsdlim: ptg step delay limit register (1,2) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ptgsdlim<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ptgsdlim<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 ptgsdlim<15:0>: ptg step delay limit register bits holds a ptg step delay value representing the numbe r of additional ptg clocks between the start of a step command, and the comple tion of the step command. note 1: a base step delay of one ptg clock is added to an y value written to the ptgsdlim register (step delay = (ptgsdlim) + 1). 2: this register is read only when the ptg mo dule is executing step commands (ptgen = 1 and ptgstrt = 1 ). register 24-7: ptgc0lim: pt g counter 0 limit register (1) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ptgc0lim<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ptgc0lim<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 ptgc0lim<15:0>: ptg counter 0 limit register bits may be used to specify the loop count for the ptgjmpc0 step command, or as a limit register for the general purpose counter 0. note 1: this register is read only when the ptg mo dule is executing step commands (ptgen = 1 and ptgstrt = 1 ).
? 2011 microchip technology inc. preliminary ds70657d-page 337 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 24-8: ptgc1lim: pt g counter 1 limit register (1) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ptgc1lim<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ptgc1lim<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 ptgc1lim<15:0>: ptg counter 1 limit register bits may be used to specify the loop count for the ptgjmpc1 step command, or as a limit register for the general purpose counter 1. note 1: this register is read only when the ptg modu le is executing step commands (ptgen = 1 and ptgstrt = 1 ). register 24-9: ptghold: ptg hold register (1) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ptghold<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ptghold<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 ptghold<15:0>: ptg general purpose hold register bits holds user supplied data to be copied to the pt gtxlim, ptgcxlim, ptgsdlim, or ptgl0 registers with the ptgcopy command. note 1: this register is read only when the ptg modu le is executing step commands (ptgen = 1 and ptgstrt = 1 ).
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 338 preliminary ? 2011 microchip technology inc. register 24-10: ptgadj : ptg adjust register (1) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ptgadj<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ptgadj<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 ptgadj<15:0>: ptg adjust register bits this register holds user supplied data to be added to the ptgtxlim, ptgcxlim, ptgsdlim, or ptgl0 registers with the ptgadd command. note 1: this register is read only when the ptg mo dule is executing step commands (ptgen = 1 and ptgstrt = 1 ). register 24-11: ptgl0: ptg literal 0 register (1) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ptgl0<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ptgl0<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 ptgl0<15:0>: ptg literal 0 register bits this register holds the 16-bit value to be written to the ad1 chs0 register with the ptgctrl step command note 1: this register is read only when the ptg mo dule is executing step commands (ptgen = 1 and ptgstrt = 1 ).
? 2011 microchip technology inc. preliminary ds70657d-page 339 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 24-12: ptgqptr: pt g step queue pointer register (1) u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? ? ptgqptr<4:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 unimplemented: read as ? 0 ? bit 4-0 ptgqptr<4:0>: ptg step queue pointer register bits this register points to the currently active step command in the step queue. note 1: this register is read only when the ptg modu le is executing step commands (ptgen = 1 and ptgstrt = 1 ). register 24-13: ptgquex: ptg step queue registers (x = 0-7) (1,3) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 step(2x +1)<7:0> (2) bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 step(2x)<7:0> (2) bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-8 step(2x +1)<7:0>: ptg step queue pointer register bits (2) a queue location for storage of the step(2x +1) command byte. bit 7-0 step(2x)<7:0>: ptg step queue pointer register bits (2) a queue location for storage of the step(2x) command byte. note 1: this register is read only when the ptg modu le is executing step commands (ptgen = 1 and ptgstrt = 1 ). 2: refer to table 24-1 for the step command encoding. 3: the step registers maintain thei r values on any type of reset.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 340 preliminary ? 2011 microchip technology inc. 24.4 step commands and format table 24-1: ptg step command format step command byte: stepx<7:0> cmd<3:0> option<3:0> bit 7 bit 4 bit 3 bit 0 bit 7-4 cmd<3:0> step command command description 0000 ptgctrl execute control command as described by option<3:0> 0001 ptgadd add contents of ptgadj register to target register as described by option<3:0> ptgcopy copy contents of ptghold register to target register as described by option<3:0> 001x ptgstrb copy the value contained in cmd<0>:o ption<3:0> to the ch0sa<4:0> bits (ad1chs0<4:0>) 0100 ptgwhi wait for a low to high edge input from se lected ptg trigger input as described by option<3:0> 0101 ptgwlo wait for a high to low edge input from se lected ptg trigger input as described by option<3:0> 0110 reserved reserved 0111 ptgirq generate individual interrupt request as described by option3<:0> 100x ptgtrig generate individual trigger output as described by <:option<3:0>> 101x ptgjmp copy the value indicated in <:option<3:0>> to the queue pointer (ptgqptr) and jump to that step queue 110x ptgjmpc0 ptgc0 = ptgc0lim: increment the queue pointer (ptgqptr) ptgc0 ptgc0lim: increment counter 0 (ptgc0) and copy the value indicated in <:option<3:0>> to the queue pointer (ptgqptr) and jump to that step queue 111x ptgjmpc1 ptgc1 = ptgc1lim: increment the queue pointer (ptgqptr) ptgc1 ptgc1lim: increment counter 1 (ptgc1) and copy the value indicated in <:option<3:0>> to the queue pointer (ptgqptr) and jump to that step queue note 1: all reserved commands or options will execut e but have no effect (i.e., execute as a nop instruction). 2: refer to table 24-2 for the trigger output descriptions. 3: this feature is only available on dspi c33epxxxmc20x/50x and pi c24epxxxmc20x devices.
? 2011 microchip technology inc. preliminary ds70657d-page 341 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x table 24-1: ptg step command format (continued) bit 3-0 step command option<3:0> option description ptgctrl (1) 0000 reserved 0001 reserved 0010 disable step delay timer (ptgsd) 0011 reserved 0100 reserved 0101 reserved 0110 enable step delay timer (ptgsd) 0111 reserved 1000 start and wait for the ptg timer 0 to match timer 0 limit register 1001 start and wait for the ptg timer 1 to match timer 1 limit register 1010 reserved 1011 wait for software trigger bit transition from low to high before continuing (ptgswt = 0 to 1 ) 1100 copy contents of the counter 0 register to the ad1chs0 register 1101 copy contents of the counter 1 register to the ad1chs0 register 1110 copy contents of the literal 0 register to the ad1chs0 register 1111 generate triggers indicated in the broadcast trigger enable register (ptgbte) ptgadd (1) 0000 add contents of ptgadj register to the counter 0 limit register (ptgc0lim) 0001 add contents of ptgadj register to the counter 1 limit register (ptgc1lim) 0010 add contents of ptgadj register to the timer 0 limit register (ptgt0lim) 0011 add contents of ptgadj register to the timer 1 limit register (ptgt1lim) 0100 add contents of ptgadj register to t he step delay limit register (ptgsdlim) 0101 add contents of ptgadj register to the literal 0 register (ptgl0) 0110 reserved 0111 reserved ptgcopy (1) 1000 copy contents of ptghold register to the counter 0 limit register (ptgc0lim) 1001 copy contents of ptghold register to the counter 1 limit register (ptgc1lim) 1010 copy contents of ptghold register to the timer 0 limit register (ptgt0lim) 1011 copy contents of ptghold register to the timer 1 limit register (ptgt1lim) 1100 copy contents of ptghold register to the step delay limit register (ptgsdlim) 1101 copy contents of ptghold register to the literal 0 register (ptgl0) 1110 reserved 1111 reserved note 1: all reserved commands or options will execut e but have no effect (i.e., execute as a nop instruction). 2: refer to table 24-2 for the trigger output descriptions. 3: this feature is only available on dspi c33epxxxmc20x/50x and pi c24epxxxmc20x devices.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 342 preliminary ? 2011 microchip technology inc. table 24-1: ptg step command format (continued) bit 3-0 step command option<3:0> option description ptgwhi (1) or ptgwlo (1) 0000 pwm special event trigger (3) 0001 pwm master timebase sy nchronization output (3) 0010 pwm1 interrupt (3) 0011 pwm2 interrupt (3) 0100 pwm3 interrupt (3) 0101 reserved 0110 reserved 0111 oc1 trigger event 1000 oc2 trigger event 1001 ic1 trigger event 1010 cmp1 trigger event 1011 cmp2 trigger event 1100 cmp3 trigger event 1101 cmp4 trigger event 1110 adc conversion done interrupt 1111 int2 external interrupt ptgirq (1) 0000 generate ptg interrupt 0 0001 generate ptg interrupt 1 0010 generate ptg interrupt 2 0011 generate ptg interrupt 3 0100 reserved ? ? ? ? ? ? 1111 reserved ptgtrig (2) 00000 ptgo0 00001 ptgo1 ? ? ? ? ? ? 11110 ptgo30 11111 ptgo31 note 1: all reserved commands or options will execut e but have no effect (i.e., execute as a nop instruction). 2: refer to table 24-2 for the trigger output descriptions. 3: this feature is only available on dspi c33epxxxmc20x/50x and pi c24epxxxmc20x devices.
? 2011 microchip technology inc. preliminary ds70657d-page 343 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x table 24-2: ptg output descriptions ptg output number ptg output description ptgo0 trigger/synchronization source for oc1 ptgo1 trigger/synchronization source for oc2 ptgo2 trigger/synchronization source for oc3 ptgo3 trigger/synchronization source for oc4 ptgo4 clock source for oc1 ptgo5 clock source for oc2 ptgo6 clock source for oc3 ptgo7 clock source for oc4 ptgo8 trigger/synchronization source for ic1 ptgo9 trigger/synchronization source for ic2 ptgo10 trigger/synchronization source for ic3 ptgo11 trigger/synchronization source for ic4 ptgo12 sample trigger for adc ptgo13 sample trigger for adc ptgo14 sample trigger for adc ptgo15 sample trigger for adc ptgo16 pwm time base synchronous source for pwm (1) ptgo17 pwm time base synchronous source for pwm (1) ptgo18 mask input select for op amp/comparator ptgo19 mask input select for op amp/comparator ptgo20 reserved ptgo21 reserved ptgo22 reserved ptgo23 reserved ptgo24 reserved ptgo25 reserved ptgo26 reserved ptgo27 reserved ptgo28 reserved ptgo29 reserved ptgo30 ptg output to pps input selection ptgo31 ptg output to pps input selection note 1: this feature is only available on dspi c33epxxxmc20x/50x and pi c24epxxxmc20x devices.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 344 preliminary ? 2011 microchip technology inc. notes:
? 2011 microchip technology inc. preliminary ds70657d-page 345 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 25.0 op amp/comparator module the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/ 50x, and pic24epxxxgp/mc 20x devices contain up to four comparators which can be configured in various ways. comparators cmp1, cmp2, and cmp3 also have the option to be configured as op amps, with the output being brought to an external pin for gain/filtering connections. as shown in figure 25-1 , individual comparator options are specified by the comparator module?s special function register (sfr) control bits. these options allow users to: ? select the edge for trigger and interrupt generation ? configure the comparator voltage reference ? configure output blanking and masking ? configure as a comparator or op amp (cmp1, cmp2, and cmp3 only) figure 25-1: op amp/comparator module block diagram note 1: this data sheet summ arizes the features of the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x families of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to section 26. ?op amp/ comparator? (ds70357) of the ? dspic33e/pic24e family reference manual ?, which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for de vice-specific register and bit information. note: not all op amp/comparator input/output connections are available on all devices. see the ?pin diagrams? section for available connections. blanking function digital filter cxout (1) (see figure 25-3 ) (see figure 25-4 ) cmp4 blanking function digital filter (see figure 25-3 ) (see figure 25-4 ) ? + v in + ptg trigger input c4out trigger output 0 1 00 01 op amp/comparator 1, 2, 3 comparator 4 c4in1+ cv refin v in - 1 0 11 00 cch<1:0> (cm4con<1:0>) oa3 c4in1- cref (cmxcon<4>) 01 10 oa1 oa2 (?x? = 1, 2, 3) cxin1+ cv refin (1) cxin1- c x in2- (1) note 1: this input/output is not available as a selection w hen configured as an op amp (opmode (cmxcon<10>) = 1 ). 2: this module can be configured either as an op amp or a comparator using the opmode bit. cmpx ? + v in - v in + cch<1:0> (cmxcon<1:0>) cref (cmxcon<4>) op amp/comparator (2) op ampx ? + oax oaxout opmode (cmxcon<10>) (to adc) r int
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 346 preliminary ? 2011 microchip technology inc. figure 25-2: op amp/comparator voltage reference block diagram figure 25-3: user-programmable blanking function block diagram 16-to-1 mux 8r r cvren cvrss = 0 av dd v ref + cvrss = 1 8r r r r r r r 16 steps cvrr cv ref 1 o cvr3 cvr2 cvr1 cvr0 cvrcon<3:0> av ss cv rsrc cvr1oe (cvrcon<6>) cv refin vrefsel (cvrcon<10>) cv ref 2 o (1) cvr2oe (cvrcon<14>) note 1: this reference is (av dd ? av ss )/2. av ss av dd 1 0 selsrca<3:0> selsrcb<3:0> selsrcc<3:0> and cmxmskcon mux a mai mbi mci comparator output to d i g i ta l signals filter or blanking blanking blanking signals signals andi mask ?and-or? function hlms mux b mux c blanking logic (cmxmskcon<15) (cmxmsksrc<11:8) (cmxmsksrc<7:4) (cmxmsksrc<3:0>) mbi mci mai mbi mci mai
? 2011 microchip technology inc. preliminary ds70657d-page 347 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x figure 25-4: digital filter interconnect block diagram c x out cfltren (cmxfltr<3>) digital filter txclk (1,2) synco1 (3) f p (4) f osc (4) cfsel<2:0> (cmxfltr<6:4>) cfdiv note 1: see the type c timer block diagram ( figure 13-2 ). 2: see the type b timer block diagram ( figure 13-1 ). 3: see the pwm module register interconnect diagram ( figure 16-2 ). 4: see the oscillator system diagram ( figure 9-1 ). from blanking logic 1xx 010 000 001 1 0
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 348 preliminary ? 2011 microchip technology inc. 25.1 op amp application considerations there are two configurations to take into consideration when designing with the op amp modules that are available in the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/ mc20x devices. configuration a (see figure 25-5 ) takes advantage of the internal connection to the adc module to route the output of the op amp directly to the adc for measurement. configuration b (see figure 25-6 ) requires that the designer externally route the output of the op amp (o axout) to a separate ana- log input pin (anx) on the device. table 30-16 in section 30.0 ?electri cal characteristics? describes the performance characteristics for the op amps, dis- tinguishing between the two configuration types where applicable. 25.1.1 op amp configuration a figure 25-5 shows a typical inverting amplifier circuit taking advantage of the internal connections from the op amp output to the input of the adc. the advantage of this configuration is that the user does not need to consume another analog input (anx) on the device, and allows the user to simultaneous sample all three op amps with the adc module, if needed. however, the presence of the internal resistance, r int 1, adds an error in the feedback path. since r int 1 is an internal resistance, in relation to the op amp output (v oa x out ) and adc internal connection (v adc ), r int 1 must be included in the numerator te rm of the transfer function. see table 30-14 in section 30.0 ?electrical charac- teristics? for the typical value of r int 1. table 30-59 and table 30-60 in section 30.0 ?electrical charac- teristics? describe the minimum sample time (t samp ) requirements for the adc modu le in this configuration. figure 25-5 also defines the equations that should be used when calculating the expected voltages at points v adc and v oa x out . figure 25-5: op amp configuration a ? + cxin1- cxin1+ r 1 adc (3) oaxout r int 1 (1) r feedback (2) cmpx (to adc) cmpx note 1: see table 30-14 for the typical value. 2: see table 30-14 for the minimum value fo r the feedback resistor. 3: see table 30-59 and table 30-60 for the minimum sample time (t samp ). v in v adc (v oa x out ) v oaxout r feedback r 1 ----------------------------- - ?? ?? v in = v adc r feedback r int 1 + r 1 -------------------------------------------------- - ?? ?? v in =
? 2011 microchip technology inc. preliminary ds70657d-page 349 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 25.1.2 op amp configuration b figure 25-6 shows a typical invert ing amplifier circuit with the output of the op amp (oaxout) externally routed to a separate analog input pin (anx) on the device. this op amp configurat ion is slightly different in terms of the op amp output and the adc input connection, therefore r int 1 is not included in the transfer function. however, this configuration requires the designer to externally route the op amp output (oaxout) to another analog input pin (anx). see table 30-14 in section 30.0 ?elect rical characteris- tics? for the typical value of r int 1. table 30-59 and table 30-60 in section 30.0 ?elect rical characteris- tics? describe the minimum sample time (t samp ) requirements for the adc module in this configuration. figure 25-6 also defines the equation to be used to calculate the expected voltage at point v oa x out . this is the typical inverting amplifier equation. figure 25-6: op amp configuration b adc (3) oaxout r feedback (2) anx note 1: see table 30-14 for the typical value. 2: see table 30-14 for the minimum value for the feedback resistor. 3: see table 30-59 and table 30-60 for the minimum sample time (t samp ). ? + cmpx (v oa x out ) r int 1 (1) v oaxout r feedback r 1 ----------------------------- - ?? ?? v in = cxin1- cxin1+ r 1 v in
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 350 preliminary ? 2011 microchip technology inc. 25.2 op amp/comparator resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 25.2.1 key resources ? section 26. ?op amp/comparator? (ds70357) ? code samples ? application notes ? software libraries ? webinars ? all related dspic33e/pic24e family reference manuals sections ? development tools note: in the event you are not able to access the product page using t he link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
? 2011 microchip technology inc. preliminary ds70657d-page 351 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 25.3 op amp/comparator registers register 25-1: cmstat: op amp/comparator status register r/w-0 u-0 u-0 u-0 r-0 r-0 r-0 r-0 cmsidl ? ? ? c4evt (1) c3evt (1) c2evt (1) c1evt (1) bit 15 bit 8 u-0 u-0 u-0 u-0 r-0 r-0 r-0 r-0 ? ? ? ?c4out (2) c3out (2) c2out (2) c1out (2) bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 cmsidl: stop in idle mode bit 1 = discontinue operation of all comparators when device enters idle mode 0 = continue operation of all comparators in idle mode bit 14-12 unimplemented: read as ? 0 ? bit 11 c4evt: op amp/comparator 4 event status bit (1) 1 = op amp/comparator event occurred 0 = op amp/comparator event did not occur bit 10 c3evt: comparator 3 event status bit (1) 1 = comparator event occurred 0 = comparator event did not occur bit 9 c2evt: comparator 2 event status bit (1) 1 = comparator event occurred 0 = comparator event did not occur bit 8 c1evt: comparator 1 event status bit (1) 1 = comparator event occurred 0 = comparator event did not occur bit 7-4 unimplemented: read as ? 0 ? bit 3 c4out: comparator 4 output status bit (2) when cpol = 0 : 1 = v in + > v in - 0 = v in + < v in - when cpol = 1 : 1 = v in + < v in - 0 = v in + > v in - note 1: reflects the value of the of the cevt bit in t he respective op amp/comparator control register, cmxcon<9>. 2: reflects the value of the cout bi t in the respective op amp/comparator control register, cmxcon<8>.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 352 preliminary ? 2011 microchip technology inc. bit 2 c3out: comparator 3 output status bit (2) when cpol = 0 : 1 = v in + > v in - 0 = v in + < v in - when cpol = 1 : 1 = v in + < v in - 0 = v in + > v in - bit 1 c2out: comparator 2 output status bit (2) when cpol = 0 : 1 = v in + > v in - 0 = v in + < v in - when cpol = 1 : 1 = v in + < v in - 0 = v in + > v in - bit 0 c1out: comparator 1 output status bit (2) when cpol = 0 : 1 = v in + > v in - 0 = v in + < v in - when cpol = 1 : 1 = v in + < v in - 0 = v in + > v in - register 25-1: cmstat: op amp/comparator status register (continued) note 1: reflects the value of the of the cevt bit in t he respective op amp/comparator control register, cmxcon<9>. 2: reflects the value of the cout bi t in the respective op amp/comparator control register, cmxcon<8>.
? 2011 microchip technology inc. preliminary ds70657d-page 353 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 25-2: cmxcon: comparator control register (x = 1, 2, or 3) r/w-0 r/w-0 r/w-0 u-0 u-0 r/w-0 r/w-0 r/w-0 con coe cpol ? ? opmode cevt cout bit 15 bit 8 r/w-0 r/w-0 u-0 r/w-0 u-0 u-0 r/w-0 r/w-0 evpol<1:0> ?cref ? ? cch<1:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 con: comparator enable bit 1 = comparator is enabled 0 = comparator is disabled bit 14 coe: comparator output enable bit 1 = comparator output is present on the cxout pin 0 = comparator output is internal only bit 13 cpol: comparator output polarity select bit 1 = comparator output is inverted 0 = comparator output is not inverted bit 12-11 unimplemented: read as ? 0 ? bit 10 opmode: op amp/comparator operation mode select bit 1 = circuit operates as an op amp 0 = circuit operates as a comparator bit 9 cevt: comparator event bit 1 = comparator event according to evpol<1:0> se ttings occurred; disables future triggers and interrupts until the bit is cleared 0 = comparator event did not occur bit 8 cout: comparator output bit when cpol = 0 (non-inverted polarity): 1 = v in + > v in - 0 = v in + < v in - when cpol = 1 (inverted polarity): 1 = v in + < v in - 0 = v in + > v in - note 1: inputs that are selected and not available will be tied to v ss . see the ?pin diagrams? section for available inputs for each package. 2: this input is not available when opmode (cmxcon<10>) = 1 .
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 354 preliminary ? 2011 microchip technology inc. bit 7-6 evpol<1:0>: trigger/event/interrupt polarity select bits 11 = trigger/event/interrupt generated on any c hange of the comparator output (while cevt = 0 ) 10 = trigger/event/interrupt generated only on hi gh to low transition of the polarity-selected comparator output (while cevt = 0 ) if cpol = 1 (inverted polarity): low-to-high transition of the comparator output if cpol = 0 (non-inverted polarity): high-to-low transition of the comparator output 01 = trigger/event/interrupt generated only on lo w to high transition of the polarity-selected comparator output (while cevt = 0 ) if cpol = 1 (inverted polarity): high-to-low transition of the comparator output if cpol = 0 (non-inverted polarity): low-to-high transition of the comparator output 00 = trigger/event/interrupt generation is disabled bit 5 unimplemented: read as ? 0 ? bit 4 cref: comparator reference select bit (v in + input) (1) 1 = v in + input connects to internal cv refin voltage (2) 0 = v in + input connects to cxin1+ pin bit 3-2 unimplemented: read as ? 0 ? bit 1-0 cch<1:0>: op amp/comparator channel select bits (1) 11 = unimplemented 10 = unimplemented 01 = inverting input of comparator connects to cxin2- pin (2) 00 = inverting input of op amp/comparator connects to cxin1- pin register 25-2: cmxcon: comparator control register (x = 1, 2, or 3) (continued) note 1: inputs that are selected and not available will be tied to v ss . see the ?pin diagrams? section for available inputs for each package. 2: this input is not available when opmode (cmxcon<10>) = 1 .
? 2011 microchip technology inc. preliminary ds70657d-page 355 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 25-3: cm4con: comparator control register r/w-0 r/w-0 r/w-0 u-0 u-0 u-0 r/w-0 r/w-0 con coe cpol ? ? ? cevt cout bit 15 bit 8 r/w-0 r/w-0 u-0 r/w-0 u-0 u-0 r/w-0 r/w-0 evpol<1:0> ?cref ? ? cch<1:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 con: comparator enable bit 1 = comparator is enabled 0 = comparator is disabled bit 14 coe: comparator output enable bit 1 = comparator output is present on the cxout pin 0 = comparator output is internal only bit 13 cpol: comparator output polarity select bit 1 = comparator output is inverted 0 = comparator output is not inverted bit 12-10 unimplemented: read as ? 0 ? bit 9 cevt: comparator event bit 1 = comparator event according to evpol<1:0> se ttings occurred; disables future triggers and interrupts until the bit is cleared 0 = comparator event did not occur bit 8 cout: comparator output bit when cpol = 0 (non-inverted polarity): 1 = v in + > v in - 0 = v in + < v in - when cpol = 1 (inverted polarity): 1 = v in + < v in - 0 = v in + > v in - bit 7-6 evpol<1:0>: trigger/event/interrupt polarity select bits 11 = trigger/event/interrupt generated on any c hange of the comparator output (while cevt = 0 ) 10 = trigger/event/interrupt generated only on hi gh to low transition of the polarity-selected comparator output (while cevt = 0 ) if cpol = 1 (inverted polarity): low-to-high transition of the comparator output if cpol = 0 (non-inverted polarity): high-to-low transition of the comparator output 01 = trigger/event/interrupt generated only on lo w to high transition of the polarity-selected comparator output (while cevt = 0 ) if cpol = 1 (inverted polarity): high-to-low transition of the comparator output if cpol = 0 (non-inverted polarity): low-to-high transition of the comparator output 00 = trigger/event/interrupt generation is disabled note 1: inputs that are selected and not available will be tied to v ss . see the ?pin diagrams? section for available inputs for each package.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 356 preliminary ? 2011 microchip technology inc. bit 5 unimplemented: read as ? 0 ? bit 4 cref: comparator reference select bit (v in + input) (1) 1 = v in + input connects to internal cv refin voltage 0 = v in + input connects to c4in1+ pin bit 3-2 unimplemented: read as ? 0 ? bit 1-0 cch<1:0>: comparator channel select bits (1) 11 = v in - input of comparator connects to cmp3 10 = v in - input of comparator connects to cmp2 01 = v in - input of comparator connects to cmp1 00 = v in - input of comparator connects to c4in1- register 25-3: cm4con: comparat or control register (continued) note 1: inputs that are selected and not available will be tied to v ss . see the ?pin diagrams? section for available inputs for each package.
? 2011 microchip technology inc. preliminary ds70657d-page 357 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 25-4: cmxmsksrc: comparator mask source select control register u-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 rw-0 ? ? ? ? selsrcc<3:0> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 selsrcb<3:0> selsrca<3:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-12 unimplemented: read as ? 0 ? bit 11-8 selsrcc<3:0>: mask c input select bits 1111 = flt4 1110 = flt2 1101 = ptgo19 1100 = ptgo18 1011 = reserved 1010 = reserved 1001 = reserved 1000 = reserved 0111 = reserved 0110 = reserved 0101 = pwm3h 0100 = pwm3l 0011 = pwm2h 0010 = pwm2l 0001 = pwm1h 0000 = pwm1l bit 7-4 selsrcb<3:0>: mask b input select bits 1111 = flt4 1110 = flt2 1101 = ptgo19 1100 = ptgo18 1011 = reserved 1010 = reserved 1001 = reserved 1000 = reserved 0111 = reserved 0110 = reserved 0101 = pwm3h 0100 = pwm3l 0011 = pwm2h 0010 = pwm2l 0001 = pwm1h 0000 = pwm1l
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 358 preliminary ? 2011 microchip technology inc. bit 3-0 selsrca<3:0>: mask a input select bits 1111 = flt4 1110 = flt2 1101 = ptgo19 1100 = ptgo18 1011 = reserved 1010 = reserved 1001 = reserved 1000 = reserved 0111 = reserved 0110 = reserved 0101 = pwm3h 0100 = pwm3l 0011 = pwm2h 0010 = pwm2l 0001 = pwm1h 0000 = pwm1l register 25-4: cmxmsksrc: comparator mask source select control register
? 2011 microchip technology inc. preliminary ds70657d-page 359 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 25-5: cmxmskcon: comparator mask gating control register r/w-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 hlms ? ocen ocnen oben obnen oaen oanen bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 nags pags acen acnen aben abnen aaen aanen bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 hlms: high or low-level masking select bits 1 = the masking (blanking) function will prevent any asserted (? 0 ?) comparator signal from propagating 0 = the masking (blanking) function will prevent any asserted (? 1 ?) comparator signal from propagating bit 14 unimplemented: read as ? 0 ? bit 13 ocen: or gate c input enable bit 1 = mci is connected to or gate 0 = mci is not connected to or gate bit 12 ocnen: or gate c input inverted enable bit 1 = inverted mci is connected to or gate 0 = inverted mci is not connected to or gate bit 11 oben: or gate b input enable bit 1 = mbi is connected to or gate 0 = mbi is not connected to or gate bit 10 obnen: or gate b input inverted enable bit 1 = inverted mbi is connected to or gate 0 = inverted mbi is not connected to or gate bit 9 oaen: or gate a input enable bit 1 = mai is connected to or gate 0 = mai is not connected to or gate bit 8 oanen: or gate a input inverted enable bit 1 = inverted mai is connected to or gate 0 = inverted mai is not connected to or gate bit 7 nags: and gate output inverted enable bit 1 = inverted andi is connected to or gate 0 = inverted andi is not connected to or gate bit 6 pags: and gate output enable bit 1 = andi is connected to or gate 0 = andi is not connected to or gate bit 5 acen: and gate c input enable bit 1 = mci is connected to and gate 0 = mci is not connected to and gate bit 4 acnen: and gate c input inverted enable bit 1 = inverted mci is connected to and gate 0 = inverted mci is not connected to and gate bit 3 aben: and gate b input enable bit 1 = mbi is connected to and gate 0 = mbi is not connected to and gate
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 360 preliminary ? 2011 microchip technology inc. bit 2 abnen: and gate b input inverted enable bit 1 = inverted mbi is connected to and gate 0 = inverted mbi is not connected to and gate bit 1 aaen: and gate a input enable bit 1 = mai is connected to and gate 0 = mai is not connected to and gate bit 0 aanen: and gate a input inverted enable bit 1 = inverted mai is connected to and gate 0 = inverted mai is not connected to and gate register 25-5: cmxmskcon: comparator mask gating control register
? 2011 microchip technology inc. preliminary ds70657d-page 361 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 25-6: cmxfltr: comparat or filter control register u-0 u-0 u-0 u-0 u-0 u-0 u-0 i-0 ? ? ? ? ? ? ? ? bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? cfsel<2:0> cfltren cfdiv<2:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-7 unimplemented: read as ? 0 ? bit 6-4 cfsel<2:0>: comparator filter input clock select bits 111 = t5clk (1) 110 = t4clk (2) 101 = t3clk (1) 100 = t2clk (2) 011 = reserved 010 = synco1 (3) 001 = f osc (4) 000 = f p (4) bit 3 cfltren: comparator filter enable bit 1 = digital filter enabled 0 = digital filter disabled bit 2-0 cfdiv<2:0>: comparator filter clock divide select bits 111 = clock divide 1:128 110 = clock divide 1:64 101 = clock divide 1:32 100 = clock divide 1:16 011 = clock divide 1:8 010 = clock divide 1:4 001 = clock divide 1:2 000 = clock divide 1:1 note 1: see the type c timer block diagram ( figure 13-2 ). 2: see the type b timer block diagram ( figure 13-1 ). 3: see the pwm module register interconnect diagram ( figure 16-2 ). 4: see the oscillator system diagram ( figure 9-1 ).
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 362 preliminary ? 2011 microchip technology inc. register 25-7: cvrcon: comparator voltage reference control register u-0 r/w-0 u-0 u-0 u-0 r/w-0 u-0 u-0 ?cvr2oe (1) ? ? ? vrefsel ? ? bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 cvren cvr1oe (1) cvrr cvrss cvr<3:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 unimplemented: read as ? 0 ? bit 14 cvr2oe: comparator voltage reference 2 output enable bit (1) 1 = (a vdd ? av ss )/2 is connected to the c vref 2 o pin 0 = (a vdd ? av ss )/2 is disconnected from the c vref 2 o pin bit 13-11 unimplemented: read as ? 0 ? bit 10 vrefsel: voltage reference select bit 1 = cv refin = v ref + 0 = cv refin is generated by the resistor network bit 9-8 unimplemented: read as ? 0 ? bit 7 cvren: comparator voltage reference enable bit 1 = comparator voltage reference circuit powered on 0 = comparator voltage reference circuit powered down bit 6 cvr1oe: comparator voltage reference 1 output enable bit (1) 1 = voltage level is output on cv ref 1 o pin 0 = voltage level is disconnected from cv ref 1 o pin bit 5 cvrr: comparator voltage reference range selection bit 1 = cv rsrc /24 step size 0 = cv rsrc /32 step size bit 4 cvrss: comparator voltage reference source selection bit 1 = comparator voltage reference source, cv rsrc = (v ref +) ? (a vss ) 0 = comparator voltage reference source, cv rsrc = av dd ? av ss bit 3-0 cvr<3:0> comparator voltage reference value selection 0 cvr<3:0> 15 bits when cvrr = 1 : cv refin = (cvr<3:0>/24) ? (cv rsrc ) when cvrr = 0 : cv refin = (cv rsrc /4) + (cvr<3:0>/32) ? (cv rsrc ) note 1: cvrxoe overrides the trisx and the anselx bit settings.
? 2011 microchip technology inc. preliminary ds70657d-page 363 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 26.0 programmable cyclic redundancy check (crc) generator the programmable crc generator offers the following features: ? user-programmable (up to 32nd order) polynomial crc equation ? interrupt output ? data fifo the programmable crc generator provides a hardware-implemented method of quickly generating checksums for various networking and security applications. it offers the following features: ? user-programmable crc polynomial equation, up to 32 bits ? programmable shift direction (little or big-endian) ? independent data and polynomial lengths ? configurable interrupt output ? data fifo a simplified block diagram of the crc generator is shown in figure 26-1 . a simple version of the crc shift engine is shown in figure 26-2 . figure 26-1: crc block diagram figure 26-2: crc shift engine detail note 1: this data sheet summ arizes the features of the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x families of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to section 27. ?program- mable cyclic redundancy check (crc)? (ds70346) of the ? dspic33e/ pic24e family reference manual ?, which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for de vice-specific register and bit information. variable fifo (4x32, 8x16 or 16x8) crcdath crcdatl shift buffer crc shift engine crcwdath crcwdatl lendian 1 0 crcisel 1 0 fifo empty event shift complete event set crcif 2 * f p shift clock crcwdath crcwdatl bit 0 bit 1 bit n (2) x(1) (1) read/write bus shift buffer data bit 2 x(2) (1) x(n) (1) note 1: each xor stage of the shift engine is programmable. see text for details. 2: polynomial length n is determined by ([plen<4:0>] + 1).
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 364 preliminary ? 2011 microchip technology inc. 26.1 overview the crc module can be programmed for crc polynomials of up to the 32nd order, using up to 32 bits. polynomial length, which reflects the highest exponent in the equation, is sele cted by the plen<4:0> bits (crccon2<4:0>). the crcxorl and crcxorh registers control which exponent terms are included in the equation. setting a particular bit includes t hat exponent term in the equation; functionally, this includes an xor operation on the corresponding bit in the crc engine. clearing the bit disables the xor. for example, consider two crc polynomials, one a 16- bit equation and the other a 32-bit equation: to program these polynomials into the crc generator, set the register bits as shown in ta b l e 2 6 - 1 . note that the appropriate positions are set to ? 1 ? to indicate that they are used in the equation (for example, x26 and x23). the 0 bit required by the equation is always xored; thus, x0 is a don?t care. for a poly- nomial of length n , it is assumed that the n th bit will always be used, regardless of the bit setting. therefore, for a polynomial length of 32, there is no 32nd bit in the crcxor register. table 26-1: crc setup examples for 16 and 32-bit polynomial 26.2 programmable crc resources many useful resources are provided on the main prod- uct page of the microchip web site for the devices listed in this data sheet. this product page, which can be accessed using this link , contains the latest updates and additional information. 26.2.1 key resources ? section 27. ?programmable cyclic redundancy check (crc)? (ds70346) ? code samples ? application notes ? software libraries ? webinars ? all related dspic33e/pic24e family reference manuals sections ? development tools x16 + x12 + x5 + 1 and x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 + x + 1 crc control bits bit values 16-bit polynomial 32-bit polynomial plen<4:0> 01111 11111 x<31:16> 0000 0000 0000 000x 0000 0100 1100 0001 x<15:0> 0001 0000 0010 000x 0001 1101 1011 011x note: in the event you are not able to access the product page using the link above, enter this url in your browser: http://www.microchip.com/wwwproducts/ devices.aspx?ddocname=en555464
? 2011 microchip technology inc. preliminary ds70657d-page 365 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 26.3 programmable crc registers register 26-1: crccon1: crc control register 1 r/w-0 u-0 r/w-0 r-0 r-0 r-0 r-0 r-0 crcen ? csidl vword<4:0> bit 15 bit 8 r-0 r-1 r/w-0 r/w-0 r/w-0 u-0 u-0 u-0 crcful crcmpt crcisel crcgo lendian ? ? ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15 crcen: crc enable bit 1 = crc module is enabled 0 = crc module is disabled. all state machines, pointers, and crcwdat/crcdat are reset. other sfrs are not reset. bit 14 unimplemented: read as ? 0 ? bit 13 csidl: crc stop in idle mode bit 1 = discontinue module operation when device enters idle mode 0 = continue module operation in idle mode bit 12-8 vword<4:0>: pointer value bits indicates the number of valid words in the fifo . has a maximum value of 8 when plen<4:0> > 7, or 16 when plen<4:0> 7. bit 7 crcful : fifo full bit 1 = fifo is full 0 = fifo is not full bit 6 crcmpt: fifo empty bit 1 = fifo is empty 0 = fifo is not empty bit 5 crcisel: crc interrupt selection bit 1 = interrupt on fifo empty; final word of data is still shifting through crc 0 = interrupt on shift complete and crcwdat results ready bit 4 crcgo: start crc bit 1 = start crc serial shifter 0 = crc serial shifter is turned off bit 3 lendian: data word little-endian configuration bit 1 = data word is shifted into the crc starting with the lsb (little endian) 0 = data word is shifted into the crc starting with the msb (big endian) bit 2-0 unimplemented: read as ? 0 ?
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 366 preliminary ? 2011 microchip technology inc. register 26-2: crccon2: crc control register 2 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? ? dwidth<4:0> bit 15 bit 8 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? ? plen<4:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-13 unimplemented: read as ? 0 ? bit 12-8 dwidth<4:0>: data width select bits these bits set the width of the data word (dwidth<4:0> + 1) bit 7-5 unimplemented: read as ? 0 ? bit 4-0 plen<4:0>: polynomial length select bits these bits set the length of the polynom ial (polynomial length = plen<4:0> + 1)
? 2011 microchip technology inc. preliminary ds70657d-page 367 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 26-3: crcxorh: crc xor polynomial high register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 x<31:24> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 x<23:16> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-0 x<31:16>: xor of polynomial term x n enable bits register 26-4: crcxorl: crc xor polynomial low register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 x<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 u-0 x<7:1> ? bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown bit 15-1 x<15:1>: xor of polynomial term x n enable bits bit 0 unimplemented: read as ? 0 ?
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 368 preliminary ? 2011 microchip technology inc. notes:
? 2011 microchip technology inc. preliminary ds70657d-page 369 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 27.0 special features DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x dev ices include several features intended to maximize application flexibility and reliability, and minimize cost through elimination of external components. these are: ? flexible configuration ? watchdog timer (wdt) ? code protection and codeguard? security ? jtag boundary scan interface ? in-circuit serial programming? (icsp?) ? in-circuit emulation 27.1 configuration bits in DSPIC33EPXXXGP50X, dspic33epxxxmc20x/ 50x, and pic24epxxxgp/mc20x devices, the configuration bytes are implem ented as volatile memory. this means that configuration data must be programmed each time the device is powered up. configuration data is stored in at the top of the on-chip program memory space, know n as the flash configura- tion bytes. their specific locations are shown in table 27-1 . the configuration data is automatically loaded from the flash configuration bytes to the proper configuration shadow registers during device resets. when creating applications for these devices, users should always specifically allocate the location of the flash configuration bytes for configuration data in their code for the compiler. this is to make certain that pro- gram code is not stored in this address when the code is compiled. the upper 2 bytes of all flash configuration words in program memory should always be ? 1111 1111 1111 1111 ?. this makes them appear to be nop instructions in the remote event that their locations are ever executed by accident. since configuration bits are not implemented in the corresponding locations, writing ? 1 ?s to these locations has no effect on device operation. the configuration flash bytes map is shown in table 27-1 . note: this data sheet summarizes the features of the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x fam ilies of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to the related section of the ? dspic33e/pic24e family reference manual ?, which is available from the microchip web site ( www.microchip.com ). note: configuration data is reloaded on all types of device resets. note: performing a page erase operation on the last page of program memory clears the flash configuration bytes, enabling code protection as a result. therefore, users should avoid performing page erase operations on the last page of program memory.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 370 preliminary ? 2011 microchip technology inc. table 27-1: configuration byte register map file name address bit 23-8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved 0057ec (1) ? ? ? ? ? ? ? ? ? 00afec (2) 0157ec (3) 02afec (4) reserved 0057ee (1) ? ? ? ? ? ? ? ? ? 00afee (2) 0157ee (3) 02afee (4) ficd 0057f0 (1) ? reserved (7) ? jtagen reserved (6) reserved (7) ?ics<1:0> 00aff0 (2) 0157f0 (3) 02aff0 (4) fpor 0057f2 (1) ? wdtwin<1:0> alti2c2 alti2c1 ? ? ? ? 00aff2 (2) 0157f2 (3) 02aff2 (4) fwdt 0057f4 (1) ? fwdten windis pllken wdtpre wdtpost<3:0> 00aff4 (2) 0157f4 (3) 02aff4 (4) fosc 0057f6 (1) ? fcksm<1:0> iol1way ? ? osciofnc poscmd<1:0> 00aff6 (2) 0157f6 (3) 02aff6 (4) foscsel 0057f8 (1) ?iesopwmlock (5) ? ? ?fnosc<2:0> 00aff8 (2) 0157f8 (3) 02aff8 (4) fgs 0057fa (1) ? ? ? ? ? ? ? gcp gwrp 00affa (2) 0157fa (3) 02affa (4) reserved 0057fc (1) ? ? ? ? ? ? ? ? ? 00affc (2) 0157fc (3) 02affc (4) reserved 057ffe (1) ? ? ? ? ? ? ? ? ? 00affe (2) 0157fe (3) 02affe (4) legend: ? = unimplemented, read as ? 1 ?. note 1: address for dspic33ep32gp/mc50x, dspic33e p32mc20x, and pic24ep32gp/mc20x devices. 2: address for dspic33ep64gp/mc50x, dspic33e p64mc20x, and pic24ep64gp/mc20x devices. 3: address for dspic33ep128gp/mc50x, dspic33ep128mc20x, and pic24ep128gp/mc20x devices. 4: address for dspic33ep256gp/mc50x, dspic33ep256mc20x, and pic24ep256gp/mc20x devices. 5: these bits are only available on dspic33epxxxmc20x/50x and pic24epxxxmc20x devices. 6: this bit is reserved and must be programmed as ? 0 ?. 7: this bit is reserved and must be programmed as ? 1 ?.
? 2011 microchip technology inc. preliminary ds70657d-page 371 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x table 27-2: configuration bits description bit field description gcp general segment code-protect bit 1 = user program memory is not code-protected 0 = code protection is enabled for the entire program memory space gwrp general segment write-protect bit 1 = user program memory is not write-protected 0 = user program memory is write-protected ieso two-speed oscillator start-up enable bit 1 = start-up device with frc, t hen automatically switch to the user-selected oscillator source when ready 0 = start-up device with user-selected oscillator source pwmlock (1) pwm lock enable bit 1 = certain pwm registers may onl y be written after key sequence 0 = pwm registers may be written without key fnosc<2:0> oscillator selection bits 111 = fast rc oscillator with divide-by-n (frcdivn) 110 = reserved; do not use 101 = low-power rc oscillator (lprc) 100 = reserved; do not use 011 = primary oscillator with pll modul e (xt + pll, hs + pll, ec + pll) 010 = primary oscillator (xt, hs, ec) 001 = fast rc oscillator with divi de-by-n with pll module (frcpll) 000 = fast rc oscillator (frc) fcksm<1:0> clock switching mode bits 1x = clock switching is disabled, fail-safe clock monitor is disabled 01 = clock switching is enabled, fail-safe clock monitor is disabled 00 = clock switching is enabled, fail-safe clock monitor is enabled iol1way peripheral pin select configuration 1 = allow only one reconfiguration 0 = allow multiple reconfigurations osciofnc osc2 pin function bit (except in xt and hs modes) 1 = osc2 is clock output 0 = osc2 is general purpose digital i/o pin poscmd<1:0> primary osci llator mode select bits 11 = primary oscillator disabled 10 = hs crystal oscillator mode 01 = xt crystal oscillator mode 00 = ec (external clock) mode fwdten watchdog timer enable bit 1 = watchdog timer always enabled (lprc oscillator cannot be disabled. clearing the swdten bit in the rcon register will have no effect.) 0 = watchdog timer enabled/disabled by user software (lprc can be disabled by clearing the swdten bit in the rcon register) windis watchdog timer window enable bit 1 = watchdog timer in non-window mode 0 = watchdog timer in window mode pllken pll lock enable bit 1 = pll lock enabled 0 = pll lock disabled wdtpre watchdog timer prescaler bit 1 = 1:128 0 = 1:32 note 1: this bit is only available on dspic33epxxxmc20x/50x and pic24epxxxmc20x devices.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 372 preliminary ? 2011 microchip technology inc. wdtpost<3:0> watchdog timer postscaler bits 1111 = 1:32,768 1110 = 1:16,384 ? ? ? 0001 = 1:2 0000 = 1:1 wdtwin<1:0> watchdog window select bits 11 = wdt window is 25% of wdt period 10 = wdt window is 37.5% of wdt period 01 = wdt window is 50% of wdt period 00 = wdt window is 75% of wdt period alti2c1 alternate i 2 c1 pins 1 = i 2 c1 mapped to sda1/scl1 pins 0 = i 2 c1 mapped to asda1/ascl1 pins alti2c2 alternate i 2 c2 pins 1 = i 2 c2 mapped to sda2/scl2 pins 0 = i 2 c2 mapped to asda2/ascl2 pins jtagen jtag enable bit 1 = jtag enabled 0 = jtag disabled ics<1:0> icd communication channel select bits 11 = communicate on pgec1 and pged1 10 = communicate on pgec2 and pged2 01 = communicate on pgec3 and pged3 00 = reserved, do not use table 27-2: configuration bits description (continued) bit field description note 1: this bit is only available on dspic33epxxxmc20x/50x and pic24epxxxmc20x devices.
? 2011 microchip technology inc. preliminary ds70657d-page 373 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x register 27-1: devid: device id register rrrrrrrr devid<23:16> bit 23 bit 16 rrrrrrrr devid<15:8> bit 15 bit 8 rrrrrrrr devid<7:0> bit 7 bit 0 legend: r = read-only bit u = unimplemented bit bit 23-0 devid<23:0>: device identifier bits (1) note 1: refer to the ?dspic33e/pic24e flash pr ogramming specification? (ds70619) for the list of device id values. register 27-2: devrev: devi ce revision register rrrrrrrr devrev<23:16> bit 23 bit 16 rrrrrrrr devrev<15:8> bit 15 bit 8 rrrrrrrr devrev<7:0> bit 7 bit 0 legend: r = read-only bit u = unimplemented bit bit 23-0 devrev<23:0>: device revision bits (1) note 1: refer to the ?dspic33e/pic24e flash pr ogramming specification? (ds70619) for the list of device revision values.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 374 preliminary ? 2011 microchip technology inc. 27.2 user id words DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x devices contain four user id words, located at addresses 0x800ff8 through 0x800ffe. the user id words can be used for storing product information such as serial numbers, system manufacturing dates, manufacturing lot numbers and other applicatio n-specific information. the user id words register map is shown in table 27-3 . table 27-3: user id words register map file name address bit 23-16 bit 15-0 fuid0 0x800ff8 ?uid0 fuid1 0x800ffa ?uid1 fuid2 0x800ffc ?uid2 fuid3 0x800ffe ?uid3 legend: ? = unimplemented, read as ?1?.
? 2011 microchip technology inc. preliminary ds70657d-page 375 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 27.3 on-chip voltage regulator all of the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/ mc20x devices power their core digital logic at a nominal 1.8v. this can create a conflict for designs that are required to operate at a higher typical voltage, such as 3.3v. to simplify system design, all devices in the DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x fami ly incorporate an on- chip regulator that allows the device to run its core logic from v dd . the regulator provides power to the core from the other v dd pins. a low-esr (less than 1 ohm) capacitor (such as tantalum or ceramic) must be connected to the v cap pin ( figure 27-1 ). this helps to maintain the stability of the regulator. the recommended value for the filter capacitor is provided in table 30-5 located in section 30.0 ?electrical characteristics? . figure 27-1: connections for the on-chip voltage regulator (1,2,3) 27.4 brown-out reset (bor) the brown-out reset (bor) module is based on an internal voltage reference circuit that monitors the reg- ulated supply voltage v cap . the main purpose of the bor module is to generate a device reset when a brown-out condition occurs. brown-out conditions are generally caused by glitches on the ac mains (for example, missing portions of the ac cycle waveform due to bad power transmission lines, or voltage sags due to excessive current draw when a large inductive load is turned on). a bor generates a reset pulse, which resets the device. the bor selects the clock source, based on the device configuration bit values (fnosc<2:0> and poscmd<1:0>). if an oscillator mode is selected, the bor activates the oscillator start-up timer (o st). the system clock is held until ost expires. if the pll is used, the clock is held until the lock bit (osccon<5>) is ? 1 ?. concurrently, the pwrt time -out (tpwrt) is applied before the internal reset is released. if tpwrt = 0 and a crystal oscillator is being used, then a nominal delay of tfscm is applied. the total delay in this case is tfscm. refer to parameter sy35 in table 30-24 of section 30.0 ?electrical characteristics? for specific t fscm values. the bor status bit (rcon<1>) is set to indicate that a bor has occurred. the bor circuit, continues to oper- ate while in sleep or idle modes and resets the device should v dd fall below the bor threshold voltage. note: it is important for the low-esr capacitor to be placed as close as possible to the v cap pin. note 1: these are typical operating voltages. refer to tab l e 3 0- 5 located in section 30.1 ?dc char- acteristics? for the full operating ranges of v dd and v cap . 2: it is important for the low-esr capacitor to be placed as close as possible to the v cap pin. 3: typical v cap pin voltage = 1.8v when v dd v ddmin . v dd v cap v ss dspic33e/pic24e 3.3v c efc
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 376 preliminary ? 2011 microchip technology inc. 27.5 watchdog timer (wdt) for DSPIC33EPXXXGP50X, dspic33epxxxmc20x/ 50x, and pic24epxxxgp/mc20x devices, the wdt is driven by the lprc o scillator. when the wdt is enabled, the clock source is also enabled. 27.5.1 prescaler/postscaler the nominal wdt clock source from lprc is 32 khz. this feeds a prescaler that can be configured for either 5-bit (divide-by-32) or 7-bit (divide-by-128) operation. the prescaler is set by the wdtpre configuration bit. with a 32 khz input, the prescaler yields a wdt time- out period (t wdt ), as shown in parameter sy12 in table 30-24 . a variable postscaler divides down the wdt prescaler output and allows for a wide range of time-out periods. the postscaler is controlled by the wdtpost<3:0> configuration bits (fwdt<3:0>), which allow the selec- tion of 16 settings, from 1:1 to 1:32,768. using the pres- caler and postscaler, time-out periods ranging from 1 ms to 131 seconds can be achieved. the wdt, prescaler and postscaler are reset: ? on any device reset ? on the completion of a clock switch, whether invoked by software (i.e., setting the oswen bit after changing the nosc bits) or by hardware (i.e., fail-safe clock monitor) ? when a pwrsav instruction is executed (i.e., sleep or idle mode is entered) ? when the device exits sleep or idle mode to resume normal operation ?by a clrwdt instruction during normal execution 27.5.2 sleep and idle modes if the wdt is enabled, it continues to run during sleep or idle modes. when the wdt time-out occurs, the device wakes the device and code execution continues from where the pwrsav instruction was executed. the corre- sponding sleep or idle bits (rcon<3,2>) needs to be cleared in software afte r the device wakes up. 27.5.3 enabling wdt the wdt is enabled or disabled by the fwdten configuration bit in the fwdt configuration register. when the fwdten configuration bit is set, the wdt is always enabled. the wdt can be optionally controlled in software when the fwdten configuration bit has been programmed to ? 0 ?. the wdt is enabled in software by setting the swdten co ntrol bit (rcon<5>). the swdten control bit is cleared on any device reset. the software wdt option allows the user application to enable the wdt for critical code segments and disable the wdt during non-critical segments for maximum power savings. the wdt flag bit, wdto (rcon< 4>), is not automatically cleared following a wdt time-out. to detect subsequent wdt events, the flag must be cleared in software. 27.5.4 wdt window the watchdog timer has an optional windowed mode enabled by programming the windis bit in the wdt configuration register (fwdt<6>). in the windowed mode (windis = 0 ), the wdt should be cleared based on the settings in the programmable watchdog window select bits (wdtwin<1:0>). figure 27-2: wdt block diagram note: the clrwdt and pwrsav instructions clear the prescaler and postscaler counts when executed. all device resets transition to new clock source exit sleep or idle mode pwrsav instruction clrwdt instruction 0 1 wdtpre wdtpost<3:0> watchdog timer prescaler (divide by n1) postscaler (divide by n2) sleep/idle wdt wdt window select windis wdt clrwdt instruction swdten fwdten lprc clock rs rs wake-up reset wdtwin<1:0>
? 2011 microchip technology inc. preliminary ds70657d-page 377 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 27.6 jtag interface DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x devices implement a jtag interface, which supports boundary scan device testing. detailed information on this interface is provided in future revisions of the document. 27.7 in-circuit serial programming the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/ 50x, and pic24epxxxgp/mc20x devices can be serially programmed while in the end application circuit. this is done with two lines for clock and data and three other lines for power, ground and the programming sequence. serial programming allows customers to manufacture boards with unprogrammed devices and then program the device just before shipping the product. serial programming also allows the most recent firmware or a custom firmware to be programmed. refer to the ?dspic33e/pic24e flash programming specification? (ds70619) for details about in-circuit serial programming (icsp). any of the three pairs of programming clock/data pins can be used: ? pgec1 and pged1 ? pgec2 and pged2 ? pgec3 and pged3 27.8 in-circuit debugger when mplab ? icd 3 or real ice? is selected as a debugger, the in-circuit debugging functionality is enabled. this function allows simple debugging func- tions when used with mplab ide. debugging function- ality is controlled through the pgecx (emulation/ debug clock) and pgedx (emulation/debug data) pin functions. any of the three pairs of debugging clock/data pins can be used: ? pgec1 and pged1 ? pgec2 and pged2 ? pgec3 and pged3 to use the in-circuit debug ger function of the device, the design must implement icsp connections to mclr , v dd , v ss , and the pgecx/pgedx pin pair. in addition, when the feature is enabled, some of the resources are not available for general use. these resources include the first 80 bytes of data ram and two i/o pins (pgecx and pgedx). 27.9 code protection and codeguard? security the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/ 50x, and pic24epxxxgp/mc20x devices offer basic implementation of codeguard security that supports only general segment (gs) se curity. this feature helps protect individual intellectual property. note: refer to section 24. ?programming and diagnostics? (ds70608) of the ?dspic33e/pic24e family reference manual? for further information on usage, configuration and operation of the jtag interface. note: refer to section 23. ?codeguard? security? (ds70634) of the ?dspic33e/ pic24e family reference manual? for further information on usage, configuration and operation of codeguard security.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 378 preliminary ? 2011 microchip technology inc. notes:
? 2011 microchip technology inc. preliminary ds70657d-page 379 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 28.0 instruction set summary the dspic33ep instruction set is almost identical to that of the dspic30f and dspic33f. the pic24ep instruction set is almost iden tical to that of the pic24f and pic24h. most instructions are a single program memory word (24 bits). only three instructions require two program memory locations. each single-word instruction is a 24-bit word, divided into an 8-bit opcode, which specifies the instruction type and one or more oper ands, which further specify the operation of the instruction. the instruction set is highly orthogonal and is grouped into five basic categories: ? word or byte-oriented operations ? bit-oriented operations ? literal operations ? dsp operations ? control operations table 28-1 lists the general symbols used in describing the instructions. the dspic33e instruct ion set summary in ta b l e 2 8 - 2 lists all the instructions, along with the status flags affected by each instruction. most word or byte-oriente d w register instructions (including barrel shift instructions) have three operands: ? the first source operand, which is typically a register ?wb? without any address modifier ? the second source operand, which is typically a register ?ws? with or without an address modifier ? the destination of the result, which is typically a register ?wd? with or wit hout an address modifier however, word or byte-oriented file register instructions have two operands: ? the file register specified by the value ?f? ? the destination, which c ould be either the file register ?f? or the w0 regi ster, which is denoted as ?wreg? most bit-oriented instructions (including simple rotate/ shift instructions) have two operands: ? the w register (with or without an address modifier) or file register (specified by the value of ?ws? or ?f?) ? the bit in the w register or file register (specified by a literal value or indire ctly by the contents of register ?wb?) the literal instructions that involve data movement can use some of the following operands: ? a literal value to be loaded into a w register or file register (specified by ?k?) ? the w register or file register where the literal value is to be loaded (specified by ?wb? or ?f?) however, literal instructions that involve arithmetic or logical operations use some of the following operands: ? the first source operand, which is a register ?wb? without any address modifier ? the second source operand, which is a literal value ? the destination of the result (only if not the same as the first source operand), which is typically a register ?wd? with or without an address modifier the mac class of dsp instructions can use some of the following operands: ? the accumulator (a or b) to be used (required operand) ? the w registers to be used as the two operands ? the x and y address space prefetch operations ? the x and y address space prefetch destinations ? the accumulator write back destination the other dsp instructions do not involve any multiplication and can include: ? the accumulator to be used (required) ? the source or destination operand (designated as wso or wdo, respectively) with or without an address modifier ? the amount of shift specif ied by a w register ?wn? or a literal value the control instructions can use some of the following operands: ? a program memory address ? the mode of the table read and table write instructions note: this data sheet summarizes the features of the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x fam ilies of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to the related section of the ? dspic33e/pic24e family reference manual ?, which is available from the microchip web site ( www.microchip.com ).
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 380 preliminary ? 2011 microchip technology inc. most instructions are a single word. certain double- word instructions are designed to provide all the required information in these 48 bits. in the second word, the 8 msbs are ? 0 ?s. if this second word is exe- cuted as an instruction (by itself), it executes as a nop . the double-word instructions execute in two instruction cycles. most single-word instructions are executed in a single instruction cycle, unless a conditional test is true, or the program counter is changed as a result of the instruction, or a psv or tabl e read is performed. in these cases, the execution takes multiple instruction cycles with the additional instruction cycle(s) executed as a nop . certain instructions that involve skipping over the subsequent instruction require either two or three cycles if the skip is performed, depending on whether the instruction being skipped is a single-word or two-word instruction. moreover, double-word moves require two cycles. note: for more details on the instruction set, refer to the ?16-bit mcu and dsc programmer?s reference manual? (ds70157). table 28-1: symbols used in opcode descriptions field description #text means literal defined by ? text ? (text) means ?content of text ? [text] means ?the location addressed by text ? { } optional field or operation a {b, c, d} a is selected from the set of values b, c, d register bit field .b byte mode selection .d double-word mode selection .s shadow register select .w word mode selection (default) acc one of two accumulators {a, b} awb accumulator write back destination address register {w13, [w13]+ = 2} bit4 4-bit bit selection field (us ed in word addressed instructions) {0...15} c, dc, n, ov, z mcu status bits: carry, digit carry, negative, overflow, sticky zero expr absolute address, label or expression (resolved by the linker) f file register address {0x0000...0x1fff} lit1 1-bit unsigned literal {0,1} lit4 4-bit unsigned literal {0...15} lit5 5-bit unsigned literal {0...31} lit8 8-bit unsigned literal {0...255} lit10 10-bit unsigned literal {0...255} for byte mode, {0:1023} for word mode lit14 14-bit unsigned literal {0...16384} lit16 16-bit unsigned literal {0...65535} lit23 23-bit unsigned literal {0...8388608}; lsb must be ? 0 ? none field does not require an entry, can be blank oa, ob, sa, sb dsp status bits: acca overflow, accb overflow, acca saturate, accb saturate pc program counter slit10 10-bit signed literal {-512...511} slit16 16-bit signed literal {-32768...32767} slit6 6-bit signed literal {-16...16} wb base w register {w0...w15} wd destination w register { wd, [wd], [wd++], [wd--], [++wd], [--wd] } wdo destination w register { wnd, [wnd], [wnd++], [wnd--], [++wnd], [--wnd], [wnd+wb] } wm,wn dividend, divisor working register pair (direct addressing)
? 2011 microchip technology inc. preliminary ds70657d-page 381 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x wm*wm multiplicand and multiplier working register pair for square instructions {w4 * w4,w5 * w5,w6 * w6,w7 * w7} wm*wn multiplicand and multiplier working register pair for dsp instructions {w4 * w5,w4 * w6,w4 * w7,w5 * w6,w5 * w7,w6 * w7} wn one of 16 working registers {w0...w15} wnd one of 16 destination working registers {w0...w15} wns one of 16 source working registers {w0...w15} wreg w0 (working register used in file register instructions) ws source w register { ws, [ws], [ws++], [ws --], [++ws], [--ws] } wso source w register { wns, [wns], [wns++], [wns--], [++wns], [--wns], [wns+wb] } wx x data space prefetch address register for dsp instructions {[w8] + = 6, [w8] + = 4, [w8] + = 2, [w8], [w8] - = 6, [w8] - = 4, [w8] - = 2, [w9] + = 6, [w9] + = 4, [w9] + = 2, [w9], [w9] - = 6, [w9] - = 4, [w9] - = 2, [w9 + w12], none} wxd x data space prefetch destinati on register for dsp instructions {w4...w7} wy y data space prefetch address register for dsp instructions {[w10] + = 6, [w10] + = 4, [w10] + = 2, [w10], [w10] - = 6, [w10] - = 4, [w10] - = 2, [w11] + = 6, [w11] + = 4, [w11] + = 2, [w11], [w11] - = 6, [w11] - = 4, [w11] - = 2, [w11 + w12], none} wyd y data space prefetch destination register for dsp instructions {w4...w7} table 28-1: symbols used in opcode descriptions (continued) field description
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 382 preliminary ? 2011 microchip technology inc. table 28-2: instruction set overview base instr # assembly mnemonic assembly syntax description # of words # of cycles status flags affected 1 add add acc (1) add accumulators 1 1 oa,ob,sa,s b add f f = f + wreg 1 1 c,dc,n,ov,z add f,wreg wreg = f + wreg 1 1 c,dc,n,ov,z add #lit10,wn wd = lit10 + wd 1 1 c,dc,n,ov,z add wb,ws,wd wd = wb + ws 1 1 c,dc,n,ov,z add wb,#lit5,wd wd = wb + lit5 1 1 c,dc,n,ov,z add wso,#slit4,acc 16-bit signed add to accumulator 1 1 oa,ob,sa,s b 2 addc addc f f = f + wreg + (c) 1 1 c,dc,n,ov,z addc f,wreg wreg = f + wreg + (c) 1 1 c,dc,n,ov,z addc #lit10,wn wd = lit10 + wd + (c) 1 1 c,dc,n,ov,z addc wb,ws,wd wd = wb + ws + (c) 1 1 c,dc,n,ov,z addc wb,#lit5,wd wd = wb + lit5 + (c) 1 1 c,dc,n,ov,z 3 and and f f = f .and. wreg 1 1 n,z and f,wreg wreg = f .and. wreg 1 1 n,z and #lit10,wn wd = lit10 .and. wd 1 1 n,z and wb,ws,wd wd = wb .and. ws 1 1 n,z and wb,#lit5,wd wd = wb .and. lit5 1 1 n,z 4 asr asr f f = arithmetic right shift f 1 1 c,n,ov,z asr f,wreg wreg = arithmetic right shift f 1 1 c,n,ov,z asr ws,wd wd = arithmetic right shift ws 1 1 c,n,ov,z asr wb,wns,wnd wnd = arithmetic right shift wb by wns 1 1 n,z asr wb,#lit5,wnd wnd = arithmetic right shift wb by lit5 1 1 n,z 5 bclr bclr f,#bit4 bit clear f 1 1 none bclr ws,#bit4 bit clear ws 1 1 none 6 bra bra c,expr branch if carry 1 1 (4) none bra ge,expr branch if greater than or equal 1 1 (4) none bra geu,expr branch if unsigned greater than or equal 1 1 (4) none bra gt,expr branch if greater than 1 1 (4) none bra gtu,expr branch if unsigned greater than 1 1 (4) none bra le,expr branch if less than or equal 1 1 (4) none bra leu,expr branch if unsigned less than or equal 1 1 (4) none bra lt,expr branch if less than 1 1 (4) none bra ltu,expr branch if unsigned less than 1 1 (4) none bra n,expr branch if negative 1 1 (4) none bra nc,expr branch if not carry 1 1 (4) none bra nn,expr branch if not negative 1 1 (4) none bra nov,expr branch if not overflow 1 1 (4) none bra nz,expr branch if not zero 1 1 (4) none bra oa,expr (1) branch if accumulator a overflow 1 1 (4) none bra ob,expr (1) branch if accumulator b overflow 1 1 (4) none bra ov,expr (1) branch if overflow 1 1 (4) none bra sa,expr (1) branch if accumulator a saturated 1 1 (4) none bra sb,expr (1) branch if accumulator b saturated 1 1 (4) none bra expr branch unconditionally 1 4 none bra z,expr branch if zero 1 1 (4) none bra wn computed branch 1 4 none 7 bset bset f,#bit4 bit set f 1 1 none bset ws,#bit4 bit set ws 1 1 none 8 bsw bsw.c ws,wb write c bit to ws 1 1 none bsw.z ws,wb write z bit to ws 1 1 none note 1: this instruction is available in dspic33e pxxxmc20x/50x and pic24epxxxmc20x devices only.
? 2011 microchip technology inc. preliminary ds70657d-page 383 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 9 btg btg f,#bit4 bit toggle f 1 1 none btg ws,#bit4 bit toggle ws 1 1 none 10 btsc btsc f,#bit4 bit test f, skip if clear 1 1 (2 or 3) none btsc ws,#bit4 bit test ws, skip if clear 1 1 (2 or 3) none 11 btss btss f,#bit4 bit test f, skip if set 1 1 (2 or 3) none btss ws,#bit4 bit test ws, skip if set 1 1 (2 or 3) none 12 btst btst f,#bit4 bit test f 1 1 z btst.c ws,#bit4 bit test ws to c 1 1 c btst.z ws,#bit4 bit test ws to z 1 1 z btst.c ws,wb bit test ws to c 1 1 c btst.z ws,wb bit test ws to z 1 1 z 13 btsts btsts f,#bit4 bit test then set f 1 1 z btsts.c ws,#bit4 bit test ws to c, then set 1 1 c btsts.z ws,#bit4 bit test ws to z, then set 1 1 z 14 call call lit23 call subroutine 2 4 sfa call wn call indirect subroutine 1 4 sfa call.l wn call indirect subroutine (long address) 1 4 sfa 15 clr clr f f = 0x0000 1 1 none clr wreg wreg = 0x0000 1 1 none clr ws ws = 0x0000 1 1 none clr acc,wx,wxd,wy,wyd,awb (1) clear accumulator 1 1 oa,ob,sa,s b 16 clrwdt clrwdt clear watchdog timer 1 1 wdto,sleep 17 com com f f = f 11 n,z com f,wreg wreg = f 11 n,z com ws,wd wd = ws 11 n,z 18 cp cp f compare f with wreg 1 1 c,dc,n,ov,z cp wb,#lit8 compare wb with lit8 1 1 c,dc,n,ov,z cp wb,ws compare wb with ws (wb ? ws) 1 1 c,dc,n,ov,z 19 cp0 cp0 f compare f with 0x0000 1 1 c,dc,n,ov,z cp0 ws compare ws with 0x0000 1 1 c,dc,n,ov,z 20 cpb cpb f compare f with wreg, with borrow 1 1 c,dc,n,ov,z cpb wb,#lit8 compare wb with lit8, with borrow 1 1 c,dc,n,ov,z cpb wb,ws compare wb with ws, with borrow (wb ? ws ? c ) 1 1 c,dc,n,ov,z 21 cpseq cpseq wb,wn compare wb with wn, skip if = 1 1 (2 or 3) none cpbeq cpbeq wb,wn,expr compare wb with wn, branch if = 1 1 (5) none 22 cpsgt cpsgt wb,wn compare wb with wn, skip if > 1 1 (2 or 3) none cpbgt cpbgt wb,wn,expr compare wb with wn, branch if > 1 1 (5) none 23 cpslt cpslt wb,wn compare wb with wn, skip if < 1 1 (2 or 3) none cpblt cpblt wb,wn,expr compare wb with wn, branch if < 1 1 (5) none 24 cpsne cpsne wb,wn compare wb with wn, skip if 11 (2 or 3) none cpbne cpbne wb,wn,expr compare wb with wn, branch if 11 (5) none table 28-2: instruction set overview (continued) base instr # assembly mnemonic assembly syntax description # of words # of cycles status flags affected note 1: this instruction is available in dspic33e pxxxmc20x/50x and pic24epxxxmc20x devices only.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 384 preliminary ? 2011 microchip technology inc. 25 daw daw wn wn = decimal adjust wn 1 1 c 26 dec dec f f = f ? 1 1 1 c,dc,n,ov,z dec f,wreg wreg = f ? 1 1 1 c,dc,n,ov,z dec ws,wd wd = ws ? 1 1 1 c,dc,n,ov,z 27 dec2 dec2 f f = f ? 2 1 1 c,dc,n,ov,z dec2 f,wreg wreg = f ? 2 1 1 c,dc,n,ov,z dec2 ws,wd wd = ws ? 2 1 1 c,dc,n,ov,z 28 disi disi #lit14 disable interrupts for k instruction cycles 1 1 none 29 div div.s wm,wn signed 16/16-bit integer divide 1 18 n,z,c,ov div.sd wm,wn signed 32/16-bit integer divide 1 18 n,z,c,ov div.u wm,wn unsigned 16/16-bit integer divide 1 18 n,z,c,ov div.ud wm,wn unsigned 32/16-bit integer divide 1 18 n,z,c,ov 30 divf divf wm,wn (1) signed 16/16-bit fractional divide 1 18 n,z,c,ov 31 do do #lit15,expr (1) do code to pc + expr, lit15 + 1 times 2 2 none do wn,expr (1) do code to pc + expr, (wn) + 1 times 2 2 none 32 ed ed wm*wm,acc,wx,wy,wxd (1) euclidean distance (no accumulate) 1 1 oa,ob,oab, sa,sb,sab 33 edac edac wm*wm,acc,wx,wy,wxd (1) euclidean distance 1 1 oa,ob,oab, sa,sb,sab 34 exch exch wns,wnd swap wns with wnd 1 1 none 35 fbcl fbcl ws,wnd find bit change from left (msb) side 1 1 c 36 ff1l ff1l ws,wnd find first one from left (msb) side 1 1 c 37 ff1r ff1r ws,wnd find first one from right (lsb) side 1 1 c 38 goto goto expr go to address 2 4 none goto wn go to indirect 1 4 none goto.l wn go to indirect (long address) 1 4 none 39 inc inc f f = f + 1 1 1 c,dc,n,ov,z inc f,wreg wreg = f + 1 1 1 c,dc,n,ov,z inc ws,wd wd = ws + 1 1 1 c,dc,n,ov,z 40 inc2 inc2 f f = f + 2 1 1 c,dc,n,ov,z inc2 f,wreg wreg = f + 2 1 1 c,dc,n,ov,z inc2 ws,wd wd = ws + 2 1 1 c,dc,n,ov,z 41 ior ior f f = f .ior. wreg 1 1 n,z ior f,wreg wreg = f .ior. wreg 1 1 n,z ior #lit10,wn wd = lit10 .ior. wd 1 1 n,z ior wb,ws,wd wd = wb .ior. ws 1 1 n,z ior wb,#lit5,wd wd = wb .ior. lit5 1 1 n,z 42 lac lac wso,#slit4,acc load accumulator 1 1 oa,ob,oab, sa,sb,sab 43 lnk lnk #lit14 link frame pointer 1 1 sfa 44 lsr lsr f f = logical right shift f 1 1 c,n,ov,z lsr f,wreg wreg = logical right shift f 1 1 c,n,ov,z lsr ws,wd wd = logical right shift ws 1 1 c,n,ov,z lsr wb,wns,wnd wnd = logical right shift wb by wns 1 1 n,z lsr wb,#lit5,wnd wnd = logical right shift wb by lit5 1 1 n,z 45 mac mac wm*wn,acc,wx,wxd,wy,wyd,awb (1) multiply and accumulate 1 1 oa,ob,oab, sa,sb,sab mac wm*wm,acc,wx,wxd,wy,wyd (1) square and accumulate 1 1 oa,ob,oab, sa,sb,sab table 28-2: instruction set overview (continued) base instr # assembly mnemonic assembly syntax description # of words # of cycles status flags affected note 1: this instruction is available in dspic33e pxxxmc20x/50x and pic24epxxxmc20x devices only.
? 2011 microchip technology inc. preliminary ds70657d-page 385 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 46 mov mov f,wn move f to wn 1 1 none mov f move f to f 1 1 none mov f,wreg move f to wreg 1 1 none mov #lit16,wn move 16-bit literal to wn 1 1 none mov.b #lit8,wn move 8-bit literal to wn 1 1 none mov wn,f move wn to f 1 1 none mov wso,wdo move ws to wd 1 1 none mov wreg,f move wreg to f 1 1 none mov.d wns,wd move double from w(ns):w(ns + 1) to wd 1 2 none mov.d ws,wnd move double from ws to w(nd + 1):w(nd) 1 2 none 47 movpag movpag #lit10,dsrpag move 10-bit literal to dsrpag 1 1 none movpag #lit9,dswpag move 9-bit literal to dswpag 1 1 none movpag #lit8,tblpag move 8-bit literal to tblpag 1 1 none movpagw ws, dsrpag move ws<9:0> to dsrpag 1 1 none movpagw ws, dswpag move ws<8:0> to dswpag 1 1 none movpagw ws, tblpag move ws<7:0> to tblpag 1 1 none 48 movsac movsac acc,wx,wxd,wy,wyd,awb (1) prefetch and store accumulator 1 1 none 49 mpy mpy wm*wn,acc,wx,wxd,wy,wyd (1) multiply wm by wn to accumulator 1 1 oa,ob,oab, sa,sb,sab mpy wm*wm,acc,wx,wxd,wy,wyd (1) square wm to accumulator 1 1 oa,ob,oab, sa,sb,sab 50 mpy.n mpy.n wm*wn,acc,wx,wxd,wy,wyd (1) -(multiply wm by wn) to accumulator 1 1 none 51 msc msc wm*wm,acc,wx,wxd,wy,wyd,awb (1) multiply and subtract from accumulator 1 1 oa,ob,oab, sa,sb,sab 52 mul mul.ss wb,ws,wnd {wnd + 1, wnd} = signed(wb) * signed(ws) 11 none mul.ss wb,ws,acc (1) accumulator = signed(wb) * signed(ws) 1 1 none mul.su wb,ws,wnd {wnd + 1, wnd} = signed(wb) * unsigned(ws) 11 none mul.su wb,ws,acc (1) accumulator = signed(wb) * unsigned(ws) 11 none mul.su wb,#lit5,acc (1) accumulator = signed(wb) * unsigned(lit5) 1 1 none mul.us wb,ws,wnd {wnd + 1, wnd} = unsigned(wb) * signed(ws) 11 none mul.us wb,ws,acc (1) accumulator = unsigned(wb) * signed(ws) 11 none mul.uu wb,ws,wnd {wnd + 1, wnd} = unsigned(wb) * unsigned(ws) 11 none mul.uu wb,#lit5,acc (1) accumulator = unsigned(wb) * unsigned(lit5) 11 none mul.uu wb,ws,acc (1) accumulator = unsigned(wb) * unsigned(ws) 11 none mulw.ss wb,ws,wnd wnd = signed(wb) * signed(ws) 1 1 none mulw.su wb,ws,wnd wnd = signed(wb) * unsigned(ws) 1 1 none mulw.us wb,ws,wnd wnd = unsigned(wb) * signed(ws) 1 1 none mulw.uu wb,ws,wnd wnd = unsigned(wb) * unsigned(ws) 1 1 none mul.su wb,#lit5,wnd {wnd + 1, wnd} = signed(wb) * unsigned(lit5) 11 none mul.su wb,#lit5,wnd wnd = signed(wb) * unsigned(lit5) 1 1 none mul.uu wb,#lit5,wnd {wnd + 1, wnd} = unsigned(wb) * unsigned(lit5) 11 none mul.uu wb,#lit5,wnd wnd = unsigned(wb) * unsigned(lit5) 1 1 none mul f w3:w2 = f * wreg 1 1 none table 28-2: instruction set overview (continued) base instr # assembly mnemonic assembly syntax description # of words # of cycles status flags affected note 1: this instruction is available in dspic33e pxxxmc20x/50x and pic24epxxxmc20x devices only.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 386 preliminary ? 2011 microchip technology inc. 53 neg neg acc (1) negate accumulator 1 1 oa,ob,oab, sa,sb,sab neg f f = f + 1 1 1 c,dc,n,ov,z neg f,wreg wreg = f + 1 1 1 c,dc,n,ov,z neg ws,wd wd = ws + 1 1 1 c,dc,n,ov,z 54 nop nop no operation 1 1 none nopr no operation 1 1 none 55 pop pop f pop f from top-of-stack (tos) 1 1 none pop wdo pop from top-of-stack (tos) to wdo 1 1 none pop.d wnd pop from top-of-stack (tos) to w(nd):w(nd + 1) 12 none pop.s pop shadow registers 1 1 all 56 push push f push f to top-of-stack (tos) 1 1 none push wso push wso to top-of-stack (tos) 1 1 none push.d wns push w(ns):w(ns + 1) to top-of-stack (tos) 12 none push.s push shadow registers 1 1 none 57 pwrsav pwrsav #lit1 go into sleep or idle mode 1 1 wdto,sleep 58 rcall rcall expr relative call 1 4 sfa rcall wn computed call 1 4 sfa 59 repeat repeat #lit15 repeat next instruction lit15 + 1 times 1 1 none repeat wn repeat next instruction (wn) + 1 times 1 1 none 60 reset reset software device reset 1 1 none 61 retfie retfie return from interrupt 1 6 (5) sfa 62 retlw retlw #lit10,wn return with literal in wn 1 6 (5) sfa 63 return return return from subroutine 1 6 (5) sfa 64 rlc rlc f f = rotate left through carry f 1 1 c,n,z rlc f,wreg wreg = rotate left through carry f 1 1 c,n,z rlc ws,wd wd = rotate left through carry ws 1 1 c,n,z 65 rlnc rlnc f f = rotate left (no carry) f 1 1 n,z rlnc f,wreg wreg = rotate left (no carry) f 1 1 n,z rlnc ws,wd wd = rotate left (no carry) ws 1 1 n,z 66 rrc rrc f f = rotate right through carry f 1 1 c,n,z rrc f,wreg wreg = rotate right through carry f 1 1 c,n,z rrc ws,wd wd = rotate right through carry ws 1 1 c,n,z 67 rrnc rrnc f f = rotate right (no carry) f 1 1 n,z rrnc f,wreg wreg = rotate right (no carry) f 1 1 n,z rrnc ws,wd wd = rotate right (no carry) ws 1 1 n,z 68 sac sac acc,#slit4,wdo (1) store accumulator 1 1 none sac.r acc,#slit4,wdo (1) store rounded accumulator 1 1 none 69 se se ws,wnd wnd = sign-extended ws 1 1 c,n,z 70 setm setm f f = 0xffff 1 1 none setm wreg wreg = 0xffff 1 1 none setm ws ws = 0xffff 1 1 none 71 sftac sftac acc,wn (1) arithmetic shift accumula tor by (wn) 1 1 oa,ob,oab, sa,sb,sab sftac acc,#slit6 (1) arithmetic shift accumula tor by slit6 1 1 oa,ob,oab, sa,sb,sab table 28-2: instruction set overview (continued) base instr # assembly mnemonic assembly syntax description # of words # of cycles status flags affected note 1: this instruction is available in dspic33e pxxxmc20x/50x and pic24epxxxmc20x devices only.
? 2011 microchip technology inc. preliminary ds70657d-page 387 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 72 sl sl f f = left shift f 1 1 c,n,ov,z sl f,wreg wreg = left shift f 1 1 c,n,ov,z sl ws,wd wd = left shift ws 1 1 c,n,ov,z sl wb,wns,wnd wnd = left shift wb by wns 1 1 n,z sl wb,#lit5,wnd wnd = left shift wb by lit5 1 1 n,z 73 sub sub acc (1) subtract accumulators 1 1 oa,ob,oab, sa,sb,sab sub f f = f ? wreg 1 1 c,dc,n,ov,z sub f,wreg wreg = f ? wreg 1 1 c,dc,n,ov,z sub #lit10,wn wn = wn ? lit10 1 1 c,dc,n,ov,z sub wb,ws,wd wd = wb ? ws 1 1 c,dc,n,ov,z sub wb,#lit5,wd wd = wb ? lit5 1 1 c,dc,n,ov,z 74 subb subb f f = f ? wreg ? (c ) 1 1 c,dc,n,ov,z subb f,wreg wreg = f ? wreg ? (c ) 1 1 c,dc,n,ov,z subb #lit10,wn wn = wn ? lit10 ? (c ) 1 1 c,dc,n,ov,z subb wb,ws,wd wd = wb ? ws ? (c ) 1 1 c,dc,n,ov,z subb wb,#lit5,wd wd = wb ? lit5 ? (c ) 1 1 c,dc,n,ov,z 75 subr subr f f = wreg ? f 1 1 c,dc,n,ov,z subr f,wreg wreg = wreg ? f 1 1 c,dc,n,ov,z subr wb,ws,wd wd = ws ? wb 1 1 c,dc,n,ov,z subr wb,#lit5,wd wd = lit5 ? wb 1 1 c,dc,n,ov,z 76 subbr subbr f f = wreg ? f ? (c ) 1 1 c,dc,n,ov,z subbr f,wreg wreg = wreg ? f ? (c ) 1 1 c,dc,n,ov,z subbr wb,ws,wd wd = ws ? wb ? (c ) 1 1 c,dc,n,ov,z subbr wb,#lit5,wd wd = lit5 ? wb ? (c ) 1 1 c,dc,n,ov,z 77 swap swap.b wn wn = nibble swap wn 1 1 none swap wn wn = byte swap wn 1 1 none 78 tblrdh tblrdh ws,wd read prog<23:16> to wd<7:0> 1 5 none 79 tblrdl tblrdl ws,wd read prog<15:0> to wd 1 5 none 80 tblwth tblwth ws,wd write ws<7:0> to prog<23:16> 1 2 none 81 tblwtl tblwtl ws,wd write ws to prog<15:0> 1 2 none 82 ulnk ulnk unlink frame pointer 1 1 sfa 83 xor xor f f = f .xor. wreg 1 1 n,z xor f,wreg wreg = f .xor. wreg 1 1 n,z xor #lit10,wn wd = lit10 .xor. wd 1 1 n,z xor wb,ws,wd wd = wb .xor. ws 1 1 n,z xor wb,#lit5,wd wd = wb .xor. lit5 1 1 n,z 84 ze ze ws,wnd wnd = zero-extend ws 1 1 c,z,n table 28-2: instruction set overview (continued) base instr # assembly mnemonic assembly syntax description # of words # of cycles status flags affected note 1: this instruction is available in dspic33e pxxxmc20x/50x and pic24epxxxmc20x devices only.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 388 preliminary ? 2011 microchip technology inc. notes:
? 2011 microchip technology inc. preliminary ds70657d-page 389 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 29.0 development support the pic ? microcontrollers and dspic ? digital signal controllers are supported with a full range of software and hardware development tools: ? integrated development environment - mplab ? ide software ? compilers/assemblers/linkers - mplab c compiler for various device families - hi-tech c ? for various device families - mpasm tm assembler -mplink tm object linker/ mplib tm object librarian - mplab assembler/link er/librarian for various device families ? simulators - mplab sim software simulator ? emulators - mplab real ice? in-circuit emulator ? in-circuit debuggers - mplab icd 3 - pickit? 3 debug express ? device programmers - pickit? 2 programmer - mplab pm3 device programmer ? low-cost demonstratio n/development boards, evaluation kits, and starter kits 29.1 mplab integrated development environment software the mplab ide software brings an ease of software development previously unseen in the 8/16/32-bit microcontroller market. the mplab ide is a windows ? operating system-based app lication that contains: ? a single graphical interface to all debugging tools - simulator - programmer (sold separately) - in-circuit emulator (sold separately) - in-circuit debugger (sold separately) ? a full-featured editor with color-coded context ? a multiple project manager ? customizable data windows with direct edit of contents ? high-level source code debugging ? mouse over variable inspection ? drag and drop variables from source to watch windows ? extensive on-line help ? integration of select thir d party tools, such as iar c compilers the mplab ide allows you to: ? edit your source files (either c or assembly) ? one-touch compile or assemble, and download to emulator and simulator tools (automatically updates all project information) ? debug using: - source files (c or assembly) - mixed c and assembly - machine code mplab ide supports multiple debugging tools in a single development paradigm, from the cost-effective simulators, through low-cost in-circuit debuggers, to full-featured emulators. this eliminates the learning curve when upgrading to tools with increased flexibility and power.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 390 preliminary ? 2011 microchip technology inc. 29.2 mplab c compilers for various device families the mplab c compiler code development systems are complete ansi c compilers for microchip?s pic18, pic24 and pic32 families of microcontrollers and the dspic30 and dspic33 families of digital signal control- lers. these compilers provide powerful integration capabilities, superior code optimization and ease of use. for easy source level debugging, the compilers provide symbol information that is optimized to the mplab ide debugger. 29.3 hi-tech c for various device families the hi-tech c compiler code development systems are complete ansi c comp ilers for microchip?s pic family of microcontrollers and the dspic family of digital signal controllers. these compilers provide powerful integration capabilities, omniscient code generation and ease of use. for easy source level debugging, the compilers provide symbol information that is optimized to the mplab ide debugger. the compilers include a macro assembler, linker, pre- processor, and one-step driver, and can run on multiple platforms. 29.4 mpasm assembler the mpasm assembler is a full-featured, universal macro assembler for pic10/12/16/18 mcus. the mpasm assembler generates relocatable object files for the mplink object linker, intel ? standard hex files, map files to detail memory usage and symbol reference, absolute lst files that contain source lines and generated machine code and coff files for debugging. the mpasm assembler features include: ? integration into mplab ide projects ? user-defined macros to streamline assembly code ? conditional assembly for multi-purpose source files ? directives that allow complete control over the assembly process 29.5 mplink object linker/ mplib object librarian the mplink object linker combines relocatable objects created by the mpasm assembler and the mplab c18 c compiler. it can link relocatable objects from precompiled libraries, using directives from a linker script. the mplib object librarian manages the creation and modification of library files of precompiled code. when a routine from a library is called from a source file, only the modules that contain that routine will be linked in with the application. this allows large libraries to be used efficiently in many different applications. the object linker/libra ry features include: ? efficient linking of single libraries instead of many smaller files ? enhanced code maintainability by grouping related modules together ? flexible creation of libraries with easy module listing, replacement, deletion and extraction 29.6 mplab assembler, linker and librarian for various device families mplab assembler produces relocatable machine code from symbolic assembly language for pic24, pic32 and dspic devices. mplab c compiler uses the assembler to produce its object file. the assembler generates relocatable objec t files that can then be archived or linked with other relocatable object files and archives to create an execut able file. notable features of the assembler include: ? support for the entire device instruction set ? support for fixed-point and floating-point data ? command line interface ? rich directive set ? flexible macro language ? mplab ide compatibility
? 2011 microchip technology inc. preliminary ds70657d-page 391 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 29.7 mplab sim software simulator the mplab sim software simulator allows code development in a pc-hosted environment by simulat- ing the pic mcus and dspic ? dscs on an instruction level. on any given instruction, the data areas can be examined or modified and stimuli can be applied from a comprehensive stimulus c ontroller. registers can be logged to files for further run-time analysis. the trace buffer and logic analyzer display extend the power of the simulator to record and track program execution, actions on i/o, most peripherals and internal registers. the mplab sim software simulator fully supports symbolic debugging using the mplab c compilers, and the mpasm and mplab assemblers. the soft- ware simulator offers the flexibility to develop and debug code outside of the hardware laboratory envi- ronment, making it an excellent, economical software development tool. 29.8 mplab real ice in-circuit emulator system mplab real ice in-circuit emulator system is microchip?s next generation high-speed emulator for microchip flash dsc and mcu devices. it debugs and programs pic ? flash mcus and dspic ? flash dscs with the easy-to-use, powerful graphical user interface of the mplab integrated devel opment environment (ide), included with each kit. the emulator is connected to the design engineer?s pc using a high-speed usb 2.0 interface and is connected to the target with either a connector compatible with in- circuit debugger systems (rj11) or with the new high- speed, noise tolerant, low-voltage differential signal (lvds) interconnection (cat5). the emulator is field upgradable through future firmware downloads in mplab ide. in upcoming releases of mplab ide, new devices will be supported, and new features will be added. mplab real ice offers significant advantages over competitive emulators including low-cost, full-speed emulation, run-time variable watches, trace analysis, complex breakpoints, a ruggedized probe interface and long (up to three meters) interconnection cables. 29.9 mplab icd 3 in-circuit debugger system mplab icd 3 in-circuit debugger system is micro- chip's most cost effective high-speed hardware debugger/programmer for microchip flash digital sig- nal controller (dsc) and microcontroller (mcu) devices. it debugs and programs pic ? flash microcon- trollers and dspic ? dscs with the powerful, yet easy- to-use graphical user interface of mplab integrated development environment (ide). the mplab icd 3 in-circuit debugger probe is con- nected to the design engineer's pc using a high-speed usb 2.0 interface and is connected to the target with a connector compatible with the mplab icd 2 or mplab real ice systems (rj-11). mplab icd 3 supports all mplab icd 2 headers. 29.10 pickit 3 in-circuit debugger/ programmer and pickit 3 debug express the mplab pickit 3 allows debugging and program- ming of pic ? and dspic ? flash microcontrollers at a most affordable price point using the powerful graphical user interface of the mp lab integrated development environment (ide). the mplab pickit 3 is connected to the design engineer's pc using a full speed usb interface and can be connec ted to the target via an microchip debug (rj-11) connector (compatible with mplab icd 3 and mplab real ice). the connector uses two device i/o pins and the reset line to imple- ment in-circuit debugging and in-circuit serial pro- gramming?. the pickit 3 debug express include the pickit 3, demo board and microcontroller, hookup cables and cdrom with user?s guide, lessons, tutorial, compiler and mplab ide software.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 392 preliminary ? 2011 microchip technology inc. 29.11 pickit 2 development programmer/debugger and pickit 2 debug express the pickit? 2 development programmer/debugger is a low-cost development tool with an easy to use inter- face for programming and debugging microchip?s flash families of microcontrollers. the full featured windows ? programming interface supports baseline (pic10f, pic12f5xx, pic16f5xx), midrange (pic12f6xx, pic16f), pic18f, pic24, dspic30, dspic33, and pic32 families of 8-bit, 16-bit, and 32-bit microcontrollers, and many microchip serial eeprom products. with microchip?s powerful mplab integrated development environmen t (ide) the pickit? 2 enables in-circuit debugging on most pic ? microcon- trollers. in-circuit-debugging runs, halts and single steps the program while the pic microcontroller is embedded in the applicatio n. when halted at a break- point, the file registers ca n be examined and modified. the pickit 2 debug express include the pickit 2, demo board and microcontroller, hookup cables and cdrom with user?s guide, lessons, tutorial, compiler and mplab ide software. 29.12 mplab pm3 device programmer the mplab pm3 device programmer is a universal, ce compliant device programmer with programmable voltage verification at v ddmin and v ddmax for maximum reliability. it features a large lcd display (128 x 64) for menus and error messages and a modu- lar, detachable socket asse mbly to support various package types. the icsp? ca ble assembly is included as a standard item. in stand-alone mode, the mplab pm3 device programmer can read, verify and program pic devices without a pc co nnection. it can also set code protection in this mode. the mplab pm3 connects to the host pc via an rs-232 or usb cable. the mplab pm3 has high-speed communications and optimized algorithms for quick programming of large memory devices and incorpor ates an mmc card for file storage and data applications. 29.13 demonstration/development boards, evaluation kits, and starter kits a wide variety of demons tration, development and evaluation boards for various pic mcus and dspic dscs allows quick application development on fully func- tional systems. most boards include prototyping areas for adding custom circuitry and provide application firmware and source code for examination and modification. the boards support a variety of features, including leds, temperature sensors, sw itches, speakers, rs-232 interfaces, lcd displays, potentiometers and additional eeprom memory. the demonstration and development boards can be used in teaching environments, for prototyping custom circuits and for learning about various microcontroller applications. in addition to the picdem? and dspicdem? demon- stration/development board series of circuits, microchip has a line of evaluation kits and demonstration software for analog filter design, k ee l oq ? security ics, can, irda ? , powersmart battery management, seeval ? evaluation system, sigma-delta adc, flow rate sensing, plus many more. also available are starter kits that contain everything needed to experience the specified device. this usually includes a single application and debug capability, all on one board. check the microchip web page ( www.microchip.com ) for the complete list of demonstration, development and evaluation kits.
? 2011 microchip technology inc. preliminary ds70657d-page 393 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 30.0 electrical characteristics this section provides an overview of dspic3 3epxxxgp50x, dspic33epxxxmc 20x/50x, and pic24epxxxgp/ mc20x electrical characteristics. additional information wil l be provided in future revisions of this document as it becomes available. absolute maximum ratings for the dspic33epxxxg p50x, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x family are listed below. exposure to these maximum rating c onditions for extended periods may affect device reliability. functional operation of the device at th ese or any other conditi ons above the parameters indicated in the operation listings of this specification is not implied. absolute maximum ratings (1) ambient temperature under bias................................................................................................. ............-40c to +125c storage temperature ............................................................................................................ .................. -65c to +150c voltage on v dd with respect to v ss ......................................................................................................... -0.3v to +4.0v voltage on any pin that is not 5v tolerant, with respect to v ss (3) ................................................... -0.3v to (v dd + 0.3v) voltage on any 5v tolerant pin with respect to v ss when v dd 3.0v (3) .................................................. -0.3v to +5.5v voltage on any 5v tolerant pin with respect to vss when v dd < 3.0v (3) .................................................... -0.3v to 3.6v maximum current out of v ss pin ........................................................................................................................... 300 ma maximum current into v dd pin (2) ...........................................................................................................................300 ma maximum current sunk/sourced by any 4x i/o pin ........ ......................................................................... .................15 ma maximum current sunk/sourced by any 8x i/o pin ........ ......................................................................... .................25 ma maximum current sunk by all ports (2,4) .................................................................................................................200 ma note 1: stresses above those listed under ?absolute maximu m ratings? may cause permanent damage to the device. this is a stress rating only, and functional o peration of the device at th ose or any other conditions above those indicated in the operation listings of this specification is not implied. exposure to maximum rating conditions for extended periods may affect device reliability. 2: maximum allowable current is a function of device maximum power dissipation (see table 30-2 ). 3: see the ? pin diagrams ? section for the 5v tolerant pins. 4: exceptions are: dspic33epxxxgp502, ds pic33epxxxmc202/502, and pic24epxxxgp/mc202 devices, which have a maximum sink/source capability of 130 ma.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 394 preliminary ? 2011 microchip technology inc. 30.1 dc characteristics table 30-1: operating mips vs. voltage characteristic v dd range (in volts) temp range (in c) maximum mips DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ? 2.95v to 3.6v (1) -40c to +85c 70 ? 2.95v to 3.6v (1) -40c to +125c 60 note 1: device is functional at v bormin < v dd < v ddmin . analog modules: adc, op amp/comparator, and comparator voltage reference will have degraded perfo rmance. device function ality is tested but not characterized. refer to parameter bo10 in table 30-12 for the minimum and maximum bor values. table 30-2: thermal operating conditions rating symbol min. typ. max. unit industrial temperature devices operating junction temperature range t j -40 ? +125 c operating ambient temperature range t a -40 ? +85 c extended temperature devices operating junction temperature range t j -40 ? +140 c operating ambient temperature range t a -40 ? +125 c power dissipation: internal chip power dissipation: p int = v dd x (i dd ? i oh ) p d p int + p i / o w i/o pin power dissipation: i/o = ({v dd ? v oh } x i oh ) + (v ol x i ol ) maximum allowed power dissipation p dmax (t j ? t a )/ ja w table 30-3: thermal packaging characteristics characteristic symbol typ. max. unit notes package thermal resi stance, 64-pin qfn ja 28.0 ? c/w 1 package thermal resistance, 64-pin tqfp 10x10 mm ja 48.3 ? c/w 1 package thermal resi stance, 44-pin qfn ja 29.0 ? c/w 1 package thermal resistance, 44-pin tqfp 10x10 mm ja 49.8 ? c/w 1 package thermal resistan ce, 44-pin vtla 6x6 mm ja 25.2 ? c/w 1 package thermal resistan ce, 36-pin vtla 5x5 mm ja 28.5 ? c/w 1 package thermal resist ance, 28-pin qfn-s ja 30.0 ? c/w 1 package thermal resi stance, 28-pin ssop ja 71.0 ? c/w 1 package thermal resi stance, 28-pin soic ja 69.7 ? c/w 1 package thermal resi stance, 28-pin spdip ja 60.0 ? c/w 1 note 1: junction to ambient thermal resistance, theta- ja ( ja ) numbers are achieved by package simulations.
? 2011 microchip technology inc. preliminary ds70657d-page 395 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x table 30-5: filter capacitor (c efc ) specifications table 30-4: dc temperature and voltage specifications dc characteristics standard operating conditions (see note3): 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a + 85c for industrial -40c t a +125c for extended param no. symbol characteristic min. typ. (1) max. units conditions operating voltage dc10 v dd supply voltage (3) 2.95 ? 3.6 v ? dc12 v dr ram data retention voltage (2) 1.8 ? ? v ? dc16 v por v dd start voltage to ensure internal power-on reset signal ??v ss v? dc17 s vdd v dd rise rate to ensure internal power-on reset signal 0.03 ? ? v/ms 0v-1v in 100 ms note 1: data in ?typical? column is at 3.3v, 25c unless otherwise stated. 2: this is the limit to which v dd may be lowered without losing ram data. 3: device is functional at v bormin < v dd < v ddmin . analog modules: adc, op amp/comparator, and comparator voltage reference will have degraded performance. device functionality is tested but not characterized. refer to parameter bo10 in table 30-12 for the minimum and maximum bor values. standard operating conditions (unless otherwise stated): operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. symbol characteristics min. typ. max. units comments c efc external filter capacitor value (1) 4.7 10 ? f capacitor must have a low series resistance (< 1 ohm) note 1: typical v cap voltage = 1.8 volts when v dd v ddmin .
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 396 preliminary ? 2011 microchip technology inc. table 30-6: dc characteristics: operating current (i dd ) dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a + 85c for industrial -40c t a +125c for extended parameter no. typ. max. units conditions operating current (i dd ) dc20d 9 15 ma -40c 3.3v 10 mips dc20a 9 15 ma +25c dc20b 9 15 ma +85c dc20c 9 15 ma +125c dc22d 16 25 ma -40c 3.3v 20 mips dc22a 16 25 ma +25c dc22b 16 25 ma +85c dc22c 16 25 ma +125c dc24d 27 35 ma -40c 3.3v 40 mips dc24a 27 35 ma +25c dc24b 27 35 ma +85c dc24c 27 35 ma +125c dc25d 36 55 ma -40c 3.3v 60 mips dc25a 36 55 ma +25c dc25b 36 55 ma +85c dc25c 36 55 ma +125c dc26d 41 60 ma -40c 3.3v 70 mips dc26a 41 60 ma +25c dc26b 41 60 ma +85c note 1: i dd is primarily a function of the operating voltage and frequency. other factors, such as i/o pin loading and switching rate, oscillator type, internal code exec ution pattern and temperatur e, also have an impact on the current consumption. t he test conditions for all i dd measurements are as follows: ? oscillator is configured in ec mode with pll, os c1 is driven with external square wave from rail-to-rail (ec clock overshoot/undershoot < 250 mv required) ? clko is configured as an i/o input pin in the configuration word ? all i/o pins are configured as inputs and pulled to v ss ?mclr = v dd , wdt and fscm are disabled ? cpu, sram, program memory and data memory are operational ? no peripheral modules are operating; however, ever y peripheral is being clocked (all pmdx bits are zeroed) ? cpu executing while(1) statement ? jtag disabled
? 2011 microchip technology inc. preliminary ds70657d-page 397 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x table 30-7: dc characteristics: idle current (i idle ) dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a + 85c for industrial -40c t a +125c for extended parameter no. typ. max. units conditions idle current (i idle ) (1) dc40d 3 5 ma -40c 3.3v 10 mips dc40a 3 5 ma +25c dc40b 3 5 ma +85c dc40c 3 5 ma +125c dc42d 6 10 ma -40c 3.3v 20 mips dc42a 6 10 ma +25c dc42b 6 10 ma +85c dc42c 6 10 ma +125c dc44d 11 18 ma -40c 3.3v 40 mips dc44a 11 18 ma +25c 18 dc44b 11 ma +85c 18 dc44c 11 ma +125c dc45d 17 27 ma -40c 3.3v 60 mips dc45a 17 27 ma +25c 27 dc45b 17 ma +85c 27 dc45c 17 ma +125c dc46d 20 35 ma -40c 3.3v 70 mips dc46a 20 35 ma +25c 35 dc46b 20 ma +85c note 1: base idle current (i idle ) is measured as follows: ? cpu core is off, oscillator is configured in ec mode and external clock active, osc1 is driven with external square wave from rail-to-rail (ec clock overshoot/ undershoot < 250 mv required) ? clko is configured as an i/o input pin in the configuration word ? all i/o pins are configured as inputs and pulled to v ss ?mclr = v dd , wdt and fscm are disabled ? no peripheral modules are operating; however, ever y peripheral is being clocked (all pmdx bits are zeroed) ? the nvmsidl bit (nvmcon<12>) = 1 (i.e., flash regulator is set to stand-by while the device is in idle mode) ? the vregsf bit (rcon<11>) = 0 (i.e., flash regulator is set to stand-by while the device is in sleep mode) ? jtag disabled
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 398 preliminary ? 2011 microchip technology inc. table 30-8: dc characteristics: power-down current (i pd ) dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a + 85c for industrial -40c t a +125c for extended parameter no. typ. max. units conditions power-down current (i pd ) (1) ? dspic33ep32gp50x, dspic33ep32mc20x/50x, and pic24ep32gp/mc20x dc60d 30 ? a -40c 3.3v base power-down current dc60a 35 ? a +25c dc60b 150 ? a +85c dc60c 250 ? a +125c dc61d 8 ? a -40c 3.3v watchdog timer current: i wdt (2) dc61a 10 ? a +25c dc61b 12 ? a +85c dc61c 13 ? a +125c power-down current (i pd ) (1) ? dspic33ep64gp50x, dspic33ep64mc20x/50x, and pic24ep64gp/mc20x dc60d 25 100 a -40c 3.3v base power-down current dc60a 30 100 a +25c dc60b 150 350 a +85c dc60c 350 800 a +125c dc61d 8 10 a -40c 3.3v watchdog timer current: i wdt (2) dc61a 10 15 a +25c dc61b 12 20 a +85c dc61c 13 25 a +125c power-down current (i pd ) (1) ? dspic33ep128gp50x, dspic33ep128 mc20x/50x, and pic24ep128gp/mc20x dc60d 30 ? a -40c 3.3v base power-down current dc60a 35 ? a +25c dc60b 150 ? a +85c dc60c 550 ? a +125c dc61d 8 ? a -40c 3.3v watchdog timer current: i wdt (2) dc61a 10 ? a +25c dc61b 12 ? a +85c dc61c 13 ? a +125c note 1: i pd (sleep) current is measured as follows: ? cpu core is off, oscillator is configured in ec mode and external clock active, osc1 is driven with external square wave from rail-to-rail (ec clock overshoot/unders hoot < 250 mv required) ? clko is configured as an i/o input pin in the configuration word ? all i/o pins are configured as inputs and pulled to v ss ?mclr = v dd , wdt and fscm are disabled ? all peripheral modules are disabled (pmdx bits are all ones) ? the vregs bit (rcon<8>) = 0 (i.e., core regulator is set to stand-by while the device is in sleep mode) ? the vregsf bit (rcon<11>) = 0 (i.e., flash regulator is set to stand-by while the device is in sleep mode) ? jtag disabled 2: the current is the additional current consumed when the module is enabled. this current should be added to the base i pd current.
? 2011 microchip technology inc. preliminary ds70657d-page 399 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x power-down current (i pd ) (1,3) ? dspic33ep256gp50x, dspic33ep256mc20x/50x, and pic24ep256gp/mc20x dc60d 35 ? a -40c 3.3v base power-down current dc60a 40 ? a +25c dc60b 250 ? a +85c dc60c 1000 ? a +125c dc61d 8 ? a -40c 3.3v watchdog timer current: i wdt (2) dc61a 10 ? a +25c dc61b 12 ? a +85c dc61c 13 ? a +125c table 30-8: dc characteristics: power-down current (i pd ) (continued) dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a + 85c for industrial -40c t a +125c for extended parameter no. typ. max. units conditions note 1: i pd (sleep) current is measured as follows: ? cpu core is off, oscillator is configured in ec mode and external clock active, osc1 is driven with external square wave from rail-to-rail (ec clock overshoot/ undershoot < 250 mv required) ? clko is configured as an i/o input pin in the configuration word ? all i/o pins are configured as inputs and pulled to v ss ?mclr = v dd , wdt and fscm are disabled ? all peripheral modules are disabled (pmdx bits are all ones) ? the vregs bit (rcon<8>) = 0 (i.e., core regulator is set to stand-by while the device is in sleep mode) ? the vregsf bit (rcon<11>) = 0 (i.e., flash regulator is set to stand-by while the device is in sleep mode) ? jtag disabled 2: the current is the additional current consumed when the module is enabled. this current should be added to the base i pd current.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 400 preliminary ? 2011 microchip technology inc. table 30-9: dc characteristics: doze current (i doze ) dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a + 85c for industrial -40c t a +125c for extended parameter no. typ. max. doze ratio units conditions doze current (i doze ) (1) dc73a 35 53 1:2 ma -40c 3.3v f osc = 140 mhz dc73g 20 30 1:128 ma dc70a 35 53 1:2 ma +25c 3.3v f osc = 140 mhz dc70g 20 30 1:128 ma dc71a 35 53 1:2 ma +85c 3.3v f osc = 140 mhz dc71g 20 30 1:128 ma dc72a 28 42 1:2 ma +125c 3.3v f osc = 120 mhz dc72g 15 30 1:128 ma note 1: i doze is primarily a function of the operating voltage and frequency. other factors, such as i/o pin loading and switching rate, oscillator type, internal code exec ution pattern and temperatur e, also have an impact on the current consumption. t he test conditions for all i doze measurements are as follows: ? oscillator is configured in ec mode and external clock active, osc1 is driven with external square wave from rail-to-rail (ec clock over shoot/undershoot < 250 mv required) ? clko is configured as an i/o input pin in the configuration word ? all i/o pins are configured as inputs and pulled to v ss ?mclr = v dd , wdt and fscm are disabled ? cpu, sram, program memory and data memory are operational ? no peripheral modules are operating; however, ever y peripheral is being clocked (all pmdx bits are zeroed) ? cpu executing while(1) statement ? jtag disabled
? 2011 microchip technology inc. preliminary ds70657d-page 401 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x table 30-10: dc characteristics: i/o pin input specifications dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. symbol characteristic min. typ. (1) max. units conditions v il input low voltage di10 any i/o pin and mclr v ss ?0.2v dd v di18 i/o pins with sdax, sclx v ss ? 0.3 v dd v smbus disabled di19 i/o pins with sdax, sclx v ss ? 0.8 v smbus enabled v ih input high voltage di20 i/o pins not 5v tolerant i/o pins 5v tolerant and mclr i/o pins with sdax, sclx i/o pins with sdax, sclx 0.7 v dd 0.7 v dd 0.7 v dd 2.1 ? ? ? ? v dd 5.3 5.3 5.3 v v v v see note 4 see note 4 smbus disabled smbus enabled i cnpu change notification pull-up current di30 50 250 400 av dd = 3.3v, v pin = v ss i cnpd change notification pull- down current (5) di31 ? 50 ? av dd = 3.3v, v pin = v dd note 1: data in ?typical? column is at 3.3v, +25c unless otherwise stated. 2: the leakage current on the mclr pin is strongly dependent on the app lied voltage level. the specified levels represent normal operating conditions. higher leakage current can be measured at different input voltages. 3: negative current is defined as current sourced by the pin. 4: see ? pin diagrams ? for the 5v tolerant i/o pins. 5: v il source < (v ss ? 0.3). characterized but not tested. 6: non-5v tolerant pins v ih source > (v dd + 0.3), 5v tolerant pins v ih source > 5.5v. characterized but not tested. 7: digital 5v tolerant pins cannot tolerate any ?positiv e? input injection current from input sources > 5.5v. 8: injection currents > | 0 | can affect the adc results by approximately 4-6 counts. 9: any number and/or combination of i/o pins not excluded under i icl or i ich conditions are permitted provided the mathematical ?absolute instantaneous? sum of the input injection currents from all pins do not exceed the specified limit. characterized but not tested.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 402 preliminary ? 2011 microchip technology inc. i il input leakage current (2,3) di50 i/o pins 5v tolerant (4) ?1? av ss v pin v dd , pin at high-impedance di51 i/o pins not 5v tolerant (4) ?1? av ss v pin v dd , pin at high-impedance, -40c t a +85c di51a i/o pins not 5v tolerant (4) ?1? a analog pins shared with external reference pins, -40c t a +85c di51b i/o pins not 5v tolerant (4) ?1? av ss v pin v dd , pin at high-impedance, -40c t a +125c di51c i/o pins not 5v tolerant (4) ?1? a analog pins shared with external reference pins, -40c t a +125c di55 mclr ?1? av ss v pin v dd di56 osc1 ? 1 ? av ss v pin v dd , xt and hs modes table 30-10: dc characteristics: i/o pin input specifications (continued) dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. symbol characteristic min. typ. (1) max. units conditions note 1: data in ?typical? column is at 3.3v, +25c unless otherwise stated. 2: the leakage current on the mclr pin is strongly dependent on the applied voltage level. the specified levels represent normal operating conditions. higher leakage current can be measured at different input voltages. 3: negative current is defined as current sourced by the pin. 4: see ? pin diagrams ? for the 5v tolerant i/o pins. 5: v il source < (v ss ? 0.3). characterized but not tested. 6: non-5v tolerant pins v ih source > (v dd + 0.3), 5v tolerant pins v ih source > 5.5v. characterized but not tested. 7: digital 5v tolerant pins cannot tolerate any ?positiv e? input injection current from input sources > 5.5v. 8: injection currents > | 0 | can affect the adc results by approximately 4-6 counts. 9: any number and/or combination of i/o pins not excluded under i icl or i ich conditions are permitted provided the mathematical ?absolute instantaneous? sum of the input injection currents from all pins do not exceed the specified limit. characterized but not tested.
? 2011 microchip technology inc. preliminary ds70657d-page 403 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x i icl input low injection current di60a 0?-5 (5,8) ma all pins except v dd , v ss , av dd , av ss , mclr , v cap , and rb7 i ich input high injection current di60b 0?+5 (6,7,8) ma all pins except v dd , v ss , av dd , av ss , mclr , v cap , rb7, and all 5v tolerant pins (7) i ict total input injection current di60c (sum of all i/o and control pins) -20 (9) ?+20 (9) ma absolute instantaneous sum of all input injection currents from all i/o pins (| i icl + | i ich |) i ict table 30-10: dc characteristics: i/o pin input specifications (continued) dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. symbol characteristic min. typ. (1) max. units conditions note 1: data in ?typical? column is at 3.3v, +25c unless otherwise stated. 2: the leakage current on the mclr pin is strongly dependent on the app lied voltage level. the specified levels represent normal operating conditions. higher leakage current can be measured at different input voltages. 3: negative current is defined as current sourced by the pin. 4: see ? pin diagrams ? for the 5v tolerant i/o pins. 5: v il source < (v ss ? 0.3). characterized but not tested. 6: non-5v tolerant pins v ih source > (v dd + 0.3), 5v tolerant pins v ih source > 5.5v. characterized but not tested. 7: digital 5v tolerant pins cannot tolerate any ?positiv e? input injection current from input sources > 5.5v. 8: injection currents > | 0 | can affect the adc results by approximately 4-6 counts. 9: any number and/or combination of i/o pins not excluded under i icl or i ich conditions are permitted provided the mathematical ?absolute instantaneous? sum of the input injection currents from all pins do not exceed the specified limit. characterized but not tested.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 404 preliminary ? 2011 microchip technology inc. table 30-11: dc characteristics: i/o pin output specifications dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param. symbol characteristic mi n. typ. max. units conditions do10 v ol output low voltage i/o pins: 4x sink driver pins - all i/o output pins not defined as 8x sink driver pins ??0.4v i ol 10 ma, v dd = 3.3v output low voltage i/o pins: 8x sink driver pins - ra3, ra4, ra9, rb7-rb15, rc3, and rc15 ??0.4v i ol 15 ma, v dd = 3.3v do20 v oh output high voltage i/o pins: 4x source driver pins - all i/o output pins not defined as 8x source driver pins 2.4 ? ? v i oh -10 ma, v dd = 3.3v output high voltage i/o pins: 8x source driver pins - ra3, ra4, ra9, rb7-rb15, rc3, and rc15 2.4 ? ? v i oh -15 ma, v dd = 3.3v do20a v oh 1 output high voltage i/o pins: 4x source driver pins - all i/o output pins not defined as 8x sink driver pins 1.5 (1) ?? v i oh -14 ma, v dd = 3.3v 2.0 (1) ?? i oh -12 ma, v dd = 3.3v 3.0 (1) ?? i oh -7 ma, v dd = 3.3v output high voltage i/o pins: 8x source driver pins - ra3, ra4, ra9, rb7-rb15, rc3, and rc15 1.5 (1) ?? v i oh -22 ma, v dd = 3.3v 2.0 (1) ?? i oh -18 ma, v dd = 3.3v 3.0 (1) ?? i oh -10 ma, v dd = 3.3v note 1: parameters are characterized, but not tested. table 30-12: electrical characteristics: bor dc characteristics standard operating conditions (see note 3): 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. symbol characteristic min. (1) typ. max. units conditions bo10 v bor bor event on v dd transition high-to-low 2.7 ? 2.95 v v dd see note 2 and note 3 note 1: parameters are for design guidance only and are not tested in manufacturing. 2: the v bor specification is relative to v dd . 3: the device is functional at v bormin < v dd < v ddmin . analog modules: adc, op amp/comparator, and comparator voltage reference, will have degraded pe rformance. device functionality is tested but not characterized.
? 2011 microchip technology inc. preliminary ds70657d-page 405 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x table 30-13: dc characteristics: program memory dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. symbol characteristic min. typ. (1) max. units conditions program flash memory d130 e p cell endurance 10,000 ? ? e/w -40 c to +125 c d131 v pr v dd for read 3.0 ? 3.6 v d132b v pew v dd for self-timed write 3.0 ? 3.6 v d134 t retd characteristic retention 20 ? ? year p rovided no other specifications are violated, -40 c to +125 c d135 i ddp supply current during programming ?10 ?ma d136 i peak instantaneous peak current during start-up ??150ma d137a t pe page erase time 19.6 ? 20.4 ms t pe = 147400 frc cycles, t a = +85c, see note 2 d137b t pe page erase time 19.5 ? 21.0 ms t pe = 149243 frc cycles, t a = +125c, see note 2 d138a t ww word write cycle time 46 ? 47.9 s t ww = 346 frc cycles, t a = +85c, see note 2 d138b t ww word write cycle time 45.8 ? 48.0 s t ww = 346 frc cycles, t a = +125c, see note 2 note 1: data in ?typical? column is at 3.3v, +25c unless otherwise stated. 2: other conditions: frc = 7.37 mhz, tun<5:0> = 'b011111 (for minimum), tun<5:0> = 'b100000 (for maximum). this parameter depen ds on the frc accuracy (see table 30-22 ) and the value of the frc oscillator tuning register (see register 9-4 ). for complete details on calculating the minimum and maximum time see section 5.3 ?programming operations? .
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 406 preliminary ? 2011 microchip technology inc. table 30-14: ac/dc characteristics: op amp/comparator dc characteristics standard operating conditions (see note 3): 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. symbol characteristic min. typ. (1) max. units conditions comparator ac characteristics cm10 t resp response time ?19? ns v+ input step of 100 mv v- input held at v dd /2 cm11 t mc 2 ov comparator mode change to output valid ??10s ? comparator dc characteristics cm30 v offset comparator offset voltage ?10? mv ? cm31 v hyst input hysteresis voltage ?30?mv ? cm32 t rise / t fall comparator output rise/fall time ?20? ns 1 pf load capacitance on input cm33 v gain open loop voltage gain ?90? db ? op amp ac characteristics cm20 s r slew rate ? 9 ? v/s 10 pf load cm21a p m phase margin (configuration a (4) ) ? 55 ? degree g = 100v/v; 10 pf load cm21b p m phase margin (configuration b (5) ) ? 40 ? degree g = 100v/v; 10 pf load cm22 g m gain margin ? 20 ? db g = 100v/v; 10 pf load cm23a g bw gain bandwidth (configuration a (4) ) ? 10 ? mhz 10 pf load cm23b g bw gain bandwidth (configuration b (5) ) ? 6 ? mhz 10 pf load op amp dc characteristics cm40 v cmr common mode input voltage range av ss ? av dd v? cm41 c mrr common mode rejection ratio ?40? dbv cm = av dd /2 cm42 v offset op amp offset voltage ? 5? mv ? cm43 v gain open loop voltage gain ?90? db ? cm44 i os input offset current ??? ? see pad leakage currents in table 30-10 cm45 i b input bias current ??? ? see pad leakage currents in table 30-10 cm46 i out output current ??420a with minimum value of r feedback (cm48) note 1: data in ?typ? column is at 3.3v, 25c unless otherwise stated. 2: resistances can vary by 10% between op amps. 3: device is functional at v bormin < v dd < v ddmin , but will have degraded performance. device functionality is tested, but not characterized. analog modules: adc, op amp/comparator, and comparator voltage reference, will have degraded performance. refer to parameter bo10 in table 30-12 for the minimum and maximum bor values. 4: see figure 25-5 for configuration information. 5: see figure 25-6 for configuration information.
? 2011 microchip technology inc. preliminary ds70657d-page 407 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x cm48 r feedback feedback resistance value 8??k ? cm49a v ol , v oh output voltage swing (configuration a (4) ) av ss + 0.075 ? av dd ? 0.075 v ? cm49b v ol , v oh output voltage swing (configuration b (5) ) av ss + 0.100 ? av dd ? 0.100 v ? cm51 r int 1 (2) internal resistance 1 (configuration a (4) and b (5) ) 198 264 317 min = -40oc typ = +25oc max = +125oc table 30-14: ac/dc characteristics: op amp/comparator (continued) dc characteristics standard operating conditions (see note 3): 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. symbol characteristic min. typ. (1) max. units conditions note 1: data in ?typ? column is at 3.3v, 25c unless otherwise stated. 2: resistances can vary by 10% between op amps. 3: device is functional at v bormin < v dd < v ddmin , but will have degraded performance. device functionality is tested, but not characterized. analog modules: adc, op amp/comparator, and comparator voltage reference, will have degraded performance. refer to parameter bo10 in table 30-12 for the minimum and maximum bor values. 4: see figure 25-5 for configuration information. 5: see figure 25-6 for configuration information.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 408 preliminary ? 2011 microchip technology inc. table 30-16: op amp/comparator voltage reference dc specifications table 30-15: op amp/comparator reference voltage settling time specifications ac characteristics standard operating conditions (see note 2): 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param. symbol characteristic mi n. typ. max. units conditions vr310 t set settling time ? 1 10 ssee note 1 note 1: settling time measured while cvrr = 1 and cvr<3:0> bits transition from ? 0000 ? to ? 1111 ?. 2: device is functional at v bormin < v dd < v ddmin , but will have degraded performance. device functionality is tested, but not characterized. analog modules: adc, op amp/comparator, and comparator voltage reference, will have degraded performance. refer to parameter bo10 in table 30-12 for the minimum and maximum bor values. dc characteristics standard operating conditions (see note 1): 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. symbol characteristics min. typ. max. units conditions vrd310 cv res resolution cv rsrc /24 ? cv rsrc /32 lsb ? vrd311 cvr aa absolute accuracy ? 25 ? mv cv rsrc = 3.3v vrd313 cv rsrc input reference voltage 0 ? av dd + 0.3 v? vrd314 cvr out buffer output resistance ? 1.5k ? ? note 1: device is functional at v bormin < v dd < v ddmin , but will have degraded perfor mance. device functionality is tested, but not characterized. analog modules: adc, op amp/comparator, and comparator voltage reference, will have degraded performance. refer to parameter bo10 in table 30-12 for the minimum and maximum bor values.
? 2011 microchip technology inc. preliminary ds70657d-page 409 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 30.2 ac characteristics and timing parameters this section defines DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/ mc20x ac characteristics and timing parameters. table 30-17: temperature and voltage specifications ? ac figure 30-1: load conditions for device timing specifications table 30-18: capacitive loading requirements on output pins ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended operating voltage v dd range as described in section 30.1 ?dc characteristics? . param no. symbol characteristic min. typ. max. units conditions do50 c osco osc2 pin ? ? 15 pf in xt and hs modes when external clock is used to drive osc1 do56 c io all i/o pins and osc2 ? ? 50 pf ec mode do58 c b sclx, sdax ? ? 400 pf in i 2 c? mode v dd /2 c l r l pin pin v ss v ss c l r l =464 c l = 50 pf for all pins except osc2 15 pf for osc2 output load condition 1 ? for all pins except osc2 load condition 2 ? for osc2
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 410 preliminary ? 2011 microchip technology inc. figure 30-2: external clock timing q1 q2 q3 q4 osc1 clko q1 q2 q3 q4 os20 os25 os30 os30 os40 os41 os31 os31 table 30-19: external clock timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. symb characteristic min. typ. (1) max. units conditions os10 f in external clki frequency (external clocks allowed only in ec and ecpll modes) dc ? 60 mhz ec oscillator crystal frequency 3.5 10 ? ? 10 25 mhz mhz xt hs os20 t osc t osc = 1/f osc 8.33 ? dc ns +125oc t osc = 1/f osc 7.14 ? dc ns +85oc os25 t cy instruction cycle time (2) 16.67 ? dc ns +125oc instruction cycle time (2) 14.28 ? dc ns +85oc os30 tosl, to s h external clock in (osc1) high or low time 0.375 x t osc ? 0.625 x t osc ns ec os31 tosr, to s f external clock in (osc1) rise or fall time ??20nsec os40 tckr clko rise time (3) ?5.2?ns ? os41 tckf clko fall time (3) ?5.2?ns ? os42 g m external oscillator transconductance (4) ? 12 ? ma/v hs, v dd = 3.3v t a = +25oc 6?ma/vxt, v dd = 3.3v t a = +25oc note 1: data in ?typical? column is at 3.3v, +25c unless otherwise stated. 2: instruction cycle period (t cy ) equals two times the input oscillator ti me base period. all specified values are based on characterization data fo r that particular oscillator type under standard operating conditions with the device executing code. exc eeding these specified limits may result in an unstable oscillator operation and/or higher than expect ed current consumption. all devi ces are tested to operate at ?minimum? values with an external clock applied to the osc1 pin. when an external clock input is used, the ?maximum? cycle time limit is ?dc? (no clock) for all devices. 3: measurements are taken in ec mode. the clko signal is measured on the osc2 pin. 4: this parameter is characterized, but not tested in manufacturing.
? 2011 microchip technology inc. preliminary ds70657d-page 411 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x table 30-20: pll clock timing specifications ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. symbol characteristic min. typ. (1) max. units conditions os50 f plli pll voltage controlled oscillator (vco) input frequency range 0.8 ? 8.0 mhz ecpll, xtpll modes os51 f sys on-chip vco system frequency 120 ? 340 mhz ? os52 t lock pll start-up time (lock time) 0.9 1.5 3.1 ms ? os53 d clk clko stability (jitter) (2) -3 0.5 3 % ? note 1: data in ?typical? column is at 3.3v, +25c unle ss otherwise stated. parameters are for design guidance only and are not tested. 2: this jitter specification is based on clock cycle-by-cl ock cycle measurements. to get the effective jitter for individual time bases or communication clocks used by the application, use the following formula: for example, if f osc = 120 mhz and the spi bit rate = 10 mhz, the effective jitter is as follows: effective jitter d clk f osc time base or communication clock -------------------------------------------------------------------------------------- - ------------------------------------------------------------------------------------------- = effective jitter d clk 120 10 -------- - ------------- - d clk 12 ------------- - d clk 3.464 ------------- - === table 30-21: internal frc accuracy ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. characteristic min. typ. max. units conditions internal frc accuracy @ frc frequency = 7.37 mhz (1) f20a frc -0.9 0.5 +0.9 % -40c t a +85c v dd = 3.0-3.6v f20b frc -2 1 +2 % -40c t a +125c v dd = 3.0-3.6v note 1: frequency calibrated at 25c and 3.3v. tun bits can be used to compensate for temperature drift. table 30-22: internal lprc accuracy ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. characteristic min. typ. max. units conditions lprc @ 32.768 khz (1) f21a lprc -15 5 +15 % -40c t a +85c v dd = 3.0-3.6v f21b lprc -30 10 +30 % -40c t a +125c v dd = 3.0-3.6v note 1: change of lprc frequency as v dd changes.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 412 preliminary ? 2011 microchip technology inc. figure 30-3: i/o timing characteristics figure 30-4: bor and master clear reset timing characteristics table 30-23: i/o timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. symbol characteristic min. typ. (1) max. units conditions do31 t io r port output rise time ? 5 10 ns ? do32 t io f port output fall time ? 5 10 ns ? di35 t inp intx pin high or low time (input) 20 ? ? ns ? di40 t rbp cnx high or low time (input) 2 ? ? t cy ? note 1: data in ?typical? column is at 3.3v, +25c unless otherwise stated. note: refer to figure 30-1 for load conditions. i/o pin (input) i/o pin (output) di35 old value new value di40 do31 do32 mclr (sy20) bor (sy30) t mclr t bor reset sequence cpu starts fetching code various delays (dependi ng on configuration)
? 2011 microchip technology inc. preliminary ds70657d-page 413 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x table 30-24: reset, watchdog timer, osci llator start-up timer, power-up timer timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. symbol characteristic (1) min. typ. (2) max. units conditions sy00 t pu power-up period ? 400 600 s ? sy10 t ost oscillator start-up time ? 1024 t osc ??t osc = osc1 period sy12 t wdt watchdog timer time-out period 0.8 ? 1.2 ms wdtpre = 0 , wdtpost = 0000 , using lprc tolerances indicated in f21 (see table 30-22 ) 3.2 ? 4.8 ms wdtpre = 1 , wdtpost = 0000 , using lprc tolerances indicated in f21 (see table 30-22 ) sy13 t ioz i/o high-impedance from mclr low or watchdog timer reset 0.68 0.72 1.2 s? sy20 t mclr mclr pulse width (low) 2 ? ? s ? sy30 t bor bor pulse width (low) 1 ? ? s? sy35 t fscm fail-safe clock monitor delay ? 500 900 s -40c to +85c sy36 t vreg voltage regulator standby-to-active mode transition time ??30s ? sy37 t oscdfrc frc oscillator start-up delay 46 48 54 s ? sy38 t oscdlprc lprc oscillator start-up delay ??70s ? note 1: these parameters are characterized but not tested in manufacturing. 2: data in ?typical? column is at 3.3v, +25c unless otherwise stated.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 414 preliminary ? 2011 microchip technology inc. figure 30-5: timer1-timer5 external clock timing characteristics note: refer to figure 30-1 for load conditions. tx11 tx15 tx10 tx20 tmrx os60 txck table 30-25: timer1 external clock timing requirements (1) ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. symbol characteristic (2) min. typ. max. units conditions ta10 t tx h txck high time synchronous mode greater of: 20 or (t cy + 20)/n ??ns must also meet parameter ta15 n = prescaler value (1, 8, 64, 256) asynchronous 35 ? ? ns ? ta11 t tx ltxck low time synchronous mode greater of: 20 or (t cy + 20)/n ? ? ns must also meet parameter ta15 n = prescaler value (1, 8, 64, 256) asynchronous 10 ? ? ns ? ta15 t tx p txck input period synchronous mode greater of: 40 or (2 t cy + 40)/n ? ? ns n = prescale value (1, 8, 64, 256) os60 ft1 t1ck oscillator input frequency range (oscillator enabled by setting bit tcs (t1con<1>)) dc ? 50 khz ? ta20 t ckextmrl delay from external txck clock edge to timer increment 0.75 t cy + 40 ? 1.75 t cy + 40 ns ? note 1: timer1 is a type a. 2: these parameters are characterized, but are not tested in manufacturing.
? 2011 microchip technology inc. preliminary ds70657d-page 415 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x table 30-26: timer2 and timer4 (type b ti mer) external clock timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. symbol characteristic (1) min. typ. max. units conditions tb10 ttxh txck high time synchronous mode greater of: 20 or (t cy + 20)/n ??ns must also meet parameter tb15 n = prescale value (1, 8, 64, 256) tb11 ttxl txck low time synchronous mode greater of: 20 or (t cy + 20)/n ? ? ns must also meet parameter tb15 n = prescale value (1, 8, 64, 256) tb15 ttxp txck input period synchronous mode greater of: 40 or (2 t cy + 40)/n ? ? ns n = prescale value (1, 8, 64, 256) tb20 t ckextmrl delay from external txck clock edge to timer increment 0.75 t cy + 40 ? 1.75 t cy + 40 ns ? note 1: these parameters are characterized, but are not tested in manufacturing. table 30-27: timer3 and timer5 (type c timer) external clock timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. symbol characteristic (1) min. typ. max. units conditions tc10 ttxh txck high time synchronous t cy + 20 ? ? ns must also meet parameter tc15 tc11 ttxl txck low time synchronous t cy + 20 ? ? ns must also meet parameter tc15 tc15 ttxp txck input period synchronous, with prescaler 2 t cy + 40 ? ? ns n = prescale value (1, 8, 64, 256) tc20 t ckextmrl delay from external txck clock edge to timer incre- ment 0.75 t cy + 40 ? 1.75 t cy + 40 ns ? note 1: these parameters are characterized, but are not tested in manufacturing.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 416 preliminary ? 2011 microchip technology inc. figure 30-6: input capture (icx) timing characteristics figure 30-7: output compare module (ocx) timing characteristics table 30-28: input capture module timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param. no. symbol characteristics (1) min. max. units conditions ic10 t cc l icx input low time greater of 12.5 + 25 or (0.5 t cy /n) + 25 ?ns must also meet parameter ic15. n = prescale value (1, 4, 16) ic11 t cc h icx input high time greater of 12.5 + 25 or (0.5 t cy /n) + 25 ?ns must also meet parameter ic15. ic15 t cc p icx input period greater of 25 + 50 or (1 t cy /n) + 50 ?ns ? note 1: these parameters are characterized, but not tested in manufacturing. table 30-29: output compare module timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. symbol characteristic (1) min. typ. max. units conditions oc10 tccf ocx output fall time ? ? ? ns see parameter do32 oc11 tccr ocx output rise time ? ? ? ns see parameter do31 note 1: these parameters are characterized but not tested in manufacturing. icx ic10 ic11 ic15 note: refer to figure 30-1 for load conditions. ocx oc11 oc10 (output compare note: refer to figure 30-1 for load conditions. or pwm mode)
? 2011 microchip technology inc. preliminary ds70657d-page 417 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x figure 30-8: oc/pwm module ti ming characteristics table 30-30: oc/pwm mode timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. symbol characteristic (1) min. typ. max. units conditions oc15 t fd fault input to pwm i/o change ??t cy + 20 ns ? oc20 t flt fault input pulse width t cy + 20 ? ? ns ? note 1: these parameters are characterized but not tested in manufacturing. ocfa ocx oc20 oc15
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 418 preliminary ? 2011 microchip technology inc. figure 30-9: high-speed pwm module fault timing characteristics (dspic33epxxxmc20x/50x and pic24 epxxxmc20x devices only) figure 30-10: high-speed pwm module timing characteristics (dspic33epxxxmc20x/50x and pi c24epxxxmc20x devices only) fault input pwmx mp30 mp20 (active-low) table 30-31: high-speed pwm module timing requirements (dspic33epxxxmc20x/50x and pi c24epxxxmc20x devices only) ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. symbol characteristic (1) min. typ. max. units conditions mp10 t fpwm pwm output fall time ? ? ? ns see parameter do32 mp11 t rpwm pwm output rise time ? ? ? ns see parameter do31 mp20 t fd fault input to pwm i/o change ??15ns ? mp30 t fh fault input pulse width 15 ? ? ns ? note 1: these parameters are characterized but not tested in manufacturing. pwmx mp11 mp10 note: refer to figure 30-1 for load conditions.
? 2011 microchip technology inc. preliminary ds70657d-page 419 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x figure 30-11: timerq (qei module) ex ternal clock timing characteristics (dspic33epxxxmc20x/50x and pic24epxxxm c20x devices only) tq11 tq15 tq10 tq20 qeb poscnt table 30-32: qei module external clock timing requirements (dspic33epxxxmc20x/50x and pic 24epxxxmc20x devices only) ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. symbol characteristic (1) min. typ. max. units conditions tq10 ttqh tqck high time synchronous, with prescaler greater of 12.5 + 25 or (0.5 t cy /n) + 25 ??ns must also meet parameter tq15. tq11 ttql tqck low time synchronous, with prescaler greater of 12.5 + 25 or (0.5 t cy /n) + 25 ??ns must also meet parameter tq15. tq15 ttqp tqcp input period synchronous, with prescaler greater of 25 + 50 or (1 t cy /n) + 50 ??ns ? tq20 t ckextmrl delay from external txck clock edge to timer incre- ment ?1t cy ?? note 1: these parameters are characterized but not tested in manufacturing.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 420 preliminary ? 2011 microchip technology inc. figure 30-12: qea/qeb input characteristics (dspic33epxxxmc20x/50x and pic24 epxxxmc20x devices only) tq30 tq35 tq31 qea (input) tq30 tq35 tq31 qeb (input) tq36 qeb internal tq40 tq41 table 30-33: quadrature decoder timing requirements (dspic33epxxxmc20x/50x and pi c24epxxxmc20x devices only) ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. symbol characteristic (1) typ. (2) max. units conditions tq30 t qu l quadrature input low time 6 t cy ?ns ? tq31 t qu h quadrature input high time 6 t cy ?ns ? tq35 t qu in quadrature input period 12 t cy ?ns ? tq36 t qu p quadrature phase period 3 t cy ?ns ? tq40 t quf l filter time to recognize low, with digital filter 3 * n * t cy ? ns n = 1, 2, 4, 16, 32, 64, 128 and 256 (note 3) tq41 t quf h filter time to recognize high, with digital filter 3 * n * t cy ? ns n = 1, 2, 4, 16, 32, 64, 128 and 256 (note 3) note 1: these parameters are characterized but not tested in manufacturing. 2: data in ?typical? column is at 3.3v, +25c unless otherwise stated. parameters are for design guidance only and are not tested. 3: n = index channel digital filter clock divide select bits. refer to section 15. ?quadrature encoder interface (qei)? (ds70601) in the ? dspic33e/pic24e family reference manual ?. please see the microchip web site for the latest family reference manual sections.
? 2011 microchip technology inc. preliminary ds70657d-page 421 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x figure 30-13: qei module index pulse timing characteristics (dspic33epxxxmc20x/50x and pic24 epxxxmc20x devices only) qea (input) ungated index qeb (input) tq55 index internal position coun- ter reset tq50 tq51 table 30-34: qei index pulse timing requirements (dspic33epxxxmc20x/50x and pi c24epxxxmc20x devices only) ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. symbol characteristic (1) min. max. units conditions tq50 tqil filter time to recognize low, with digital filter 3 * n * t cy ? ns n = 1, 2, 4, 16, 32, 64, 128 and 256 (note 2) tq51 tqih filter time to recognize high, with digital filter 3 * n * t cy ? ns n = 1, 2, 4, 16, 32, 64, 128 and 256 (note 2) tq55 tqidxr index pulse recognized to position counter reset (ungated index) 3 t cy ?ns ? note 1: these parameters are characterized but not tested in manufacturing. 2: alignment of index pulses to qea and qeb is shown for position counter reset timing only. shown for forward direction only (qea leads qeb). same timing applies for reverse direction (qea lags qeb) but index pulse recognition occurs on falling edge.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 422 preliminary ? 2011 microchip technology inc. table 30-35: spi2 maximum data/clock rate summary figure 30-14: spi2 master mode (half-duplex, transmit only cke = 0 ) timing characteristics figure 30-15: spi2 master mode (half-duplex, transmit only cke = 1 ) timing characteristics ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended maximum data rate master transmit only (half-duplex) master transmit/receive (full-duplex) slave transmit/receive (full-duplex) cke ckp smp 15 mhz table 30-35 ?? 0 , 10 , 10 , 1 9 mhz ? table 30-36 ? 10 , 11 9 mhz ? table 30-37 ? 00 , 11 15 mhz ? ? table 30-38 100 11 mhz ? ? table 30-39 110 15 mhz ? ? table 30-40 010 11 mhz ? ? table 30-41 000 sckx (ckp = 0 ) sckx (ckp = 1 ) sdox sp10 sp21 sp20 sp35 sp20 sp21 msb lsb bit 14 - - - - - -1 sp30, sp31 sp30, sp31 note: refer to figure 30-1 for load conditions. sckx (ckp = 0 ) sckx (ckp = 1 ) sdox sp10 sp21 sp20 sp35 sp20 sp21 msb lsb bit 14 - - - - - -1 sp30, sp31 note: refer to figure 30-1 for load conditions. sp36
? 2011 microchip technology inc. preliminary ds70657d-page 423 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x table 30-36: spi2 master mode (half-dupl ex, transmit only) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param. symbol characteristic (1) min. typ. (2) max. units conditions sp10 tscp maximum sck frequency ? ? 15 mhz see note 3 sp20 tscf sckx output fall time ? ? ? ns see parameter do32 and note 4 sp21 tscr sckx output rise time ? ? ? ns see parameter do31 and note 4 sp30 tdof sdox data output fall time ? ? ? ns see parameter do32 and note 4 sp31 tdor sdox data output rise time ? ? ? ns see parameter do31 and note 4 sp35 tsch2dov, tscl2dov sdox data output valid after sckx edge ?620ns ? sp36 tdiv2sch, tdiv2scl sdox data output setup to first sckx edge 30 ? ? ns ? note 1: these parameters are characterized, but are not tested in manufacturing. 2: data in ?typical? column is at 3.3v, +25c unless otherwise stated. 3: the minimum clock period for sckx is 66.7 ns. theref ore, the clock generated in master mode must not violate this specification. 4: assumes 50 pf load on all spix pins.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 424 preliminary ? 2011 microchip technology inc. figure 30-16: spi2 master mode (full-duplex, cke = 1 , ckp = x , smp = 1 ) timing characteristics table 30-37: spi2 master mode (full-duplex, cke = 1 , ckp = x , smp = 1 ) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param. symbol characteristic (1) min. typ. (2) max. units conditions sp10 tscp maximum sck frequency ? ? 9 mhz see note 3 sp20 tscf sckx output fall time ? ? ? ns see parameter do32 and note 4 sp21 tscr sckx output rise time ? ? ? ns see parameter do31 and note 4 sp30 tdof sdox data output fall time ? ? ? ns see parameter do32 and note 4 sp31 tdor sdox data output rise time ? ? ? ns see parameter do31 and note 4 sp35 tsch2dov, tscl2dov sdox data output valid after sckx edge ? 6 20 ns ? sp36 tdov2sc, tdov2scl sdox data output setup to first sckx edge 30 ? ? ns ? sp40 tdiv2sch, tdiv2scl setup time of sdix data input to sckx edge 30 ? ? ns ? sp41 tsch2dil, tscl2dil hold time of sdix data input to sckx edge 30 ? ? ns ? note 1: these parameters are characterized, but are not tested in manufacturing. 2: data in ?typical? column is at 3.3v, +25c unless otherwise stated. 3: the minimum clock period for sckx is 111 ns. the clock generated in master mode must not violate this specification. 4: assumes 50 pf load on all spix pins. sckx (ckp = 0 ) sckx (ckp = 1 ) sdox sp10 sp21 sp20 sp35 sp20 sp21 msb lsb bit 14 - - - - - -1 sp30, sp31 note: refer to figure 30-1 for load conditions. sp36 sp41 msb in lsb in bit 14 - - - -1 sdix sp40
? 2011 microchip technology inc. preliminary ds70657d-page 425 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x figure 30-17: spi2 master mode (full-duplex, cke = 0 , ckp = x , smp = 1 ) timing characteristics table 30-38: spi2 master mo de (full-duplex, cke = 0 , ckp = x , smp = 1 ) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param. symbol characteristic (1) min. typ. (2) max. units conditions sp10 tscp maximum sck frequency ? ? 9 mhz -40oc to +125oc and see note 3 sp20 tscf sckx output fall time ? ? ? ns see parameter do32 and note 4 sp21 tscr sckx output rise time ? ? ? ns see parameter do31 and note 4 sp30 tdof sdox data output fall time ? ? ? ns see parameter do32 and note 4 sp31 tdor sdox data output rise time ? ? ? ns see parameter do31 and note 4 sp35 tsch2dov, tscl2dov sdox data output valid after sckx edge ? 6 20 ns ? sp36 tdov2sch, tdov2scl sdox data output setup to first sckx edge 30 ? ? ns ? sp40 tdiv2sch, tdiv2scl setup time of sdix data input to sckx edge 30 ? ? ns ? sp41 tsch2dil, tscl2dil hold time of sdix data input to sckx edge 30 ? ? ns ? note 1: these parameters are characterized, but are not tested in manufacturing. 2: data in ?typical? column is at 3.3v, +25c unless otherwise stated. 3: the minimum clock period for sckx is 111 ns. the clock generated in master mode must not violate this specification. 4: assumes 50 pf load on all spix pins. sckx (ckp = 0 ) sckx (ckp = 1 ) sdox sdix sp10 sp40 sp41 sp21 sp20 sp35 sp20 sp21 msb lsb bit 14 - - - - - -1 msb in lsb in bit 14 - - - -1 sp30, sp31 sp30, sp31 note: refer to figure 30-1 for load conditions. sp36
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 426 preliminary ? 2011 microchip technology inc. figure 30-18: spi2 slave mode (full-duplex, cke = 1 , ckp = 0 , smp = 0 ) timing characteristics ssx sckx (ckp = 0 ) sckx (ckp = 1 ) sdox sdi sp50 sp60 sdix sp30,sp31 msb bit 14 - - - - - -1 lsb sp51 msb in bit 14 - - - -1 lsb in sp35 sp52 sp73 sp72 sp72 sp73 sp70 sp40 sp41 note: refer to figure 30-1 for load conditions. sp36
? 2011 microchip technology inc. preliminary ds70657d-page 427 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x table 30-39: spi2 slave mo de (full-duplex, cke = 1 , ckp = 0 , smp = 0 ) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param. symbol characteristic (1) min. typ. (2) max. units conditions sp70 tscp maximum sck input frequency ? ? 15 mhz see note 3 sp72 tscf sckx input fall time ? ? ? ns see parameter do32 and note 4 sp73 tscr sckx input rise time ? ? ? ns see parameter do31 and note 4 sp30 tdof sdox data output fall time ? ? ? ns see parameter do32 and note 4 sp31 tdor sdox data output rise time ? ? ? ns see parameter do31 and note 4 sp35 tsch2dov, tscl2dov sdox data output valid after sckx edge ? 6 20 ns ? sp36 tdov2sch, tdov2scl sdox data output setup to first sckx edge 30 ? ? ns ? sp40 tdiv2sch, tdiv2scl setup time of sdix data input to sckx edge 30 ? ? ns ? sp41 tsch2dil, tscl2dil hold time of sdix data input to sckx edge 30 ? ? ns ? sp50 tssl2sch, tssl2scl ssx to sckx or sckx input 120 ? ? ns ? sp51 tssh2doz ssx to sdox output high-impedance (4) 10 ? 50 ns ? sp52 tsch2ssh tscl2ssh ssx after sckx edge 1.5 t cy + 40 ? ? ns see note 4 sp60 tssl2dov sdox data output valid after ssx edge ? ? 50 ns ? note 1: these parameters are characterized, but are not tested in manufacturing. 2: data in ?typical? column is at 3.3v, +25c unless otherwise stated. 3: the minimum clock period for sckx is 66.7 ns. ther efore, the sck clock gener ated by the master must not violate this specification. 4: assumes 50 pf load on all spix pins.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 428 preliminary ? 2011 microchip technology inc. figure 30-19: spi2 slave mode (full-duplex, cke = 1 , ckp = 1 , smp = 0 ) timing characteristics ssx sckx (ckp = 0 ) sckx (ckp = 1 ) sdox sdi sp50 sp60 sdix sp30,sp31 msb bit 14 - - - - - -1 lsb sp51 msb in bit 14 - - - -1 lsb in sp35 sp52 sp73 sp72 sp72 sp73 sp70 sp40 sp41 note: refer to figure 30-1 for load conditions. sp36
? 2011 microchip technology inc. preliminary ds70657d-page 429 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x table 30-40: spi2 slave mo de (full-duplex, cke = 1 , ckp = 1 , smp = 0 ) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param. symbol characteristic (1) min. typ. (2) max. units conditions sp70 tscp maximum sck input frequency ? ? 11 mhz see note 3 sp72 tscf sckx input fall time ? ? ? ns see parameter do32 and note 4 sp73 tscr sckx input rise time ? ? ? ns see parameter do31 and note 4 sp30 tdof sdox data output fall time ? ? ? ns see parameter do32 and note 4 sp31 tdor sdox data output rise time ? ? ? ns see parameter do31 and note 4 sp35 tsch2dov, tscl2dov sdox data output valid after sckx edge ? 6 20 ns ? sp36 tdov2sch, tdov2scl sdox data output setup to first sckx edge 30 ? ? ns ? sp40 tdiv2sch, tdiv2scl setup time of sdix data input to sckx edge 30 ? ? ns ? sp41 tsch2dil, tscl2dil hold time of sdix data input to sckx edge 30 ? ? ns ? sp50 tssl2sch, tssl2scl ssx to sckx or sckx input 120 ? ? ns ? sp51 tssh2doz ssx to sdox output high-impedance (4) 10 ? 50 ns ? sp52 tsch2ssh tscl2ssh ssx after sckx edge 1.5 t cy + 40 ? ? ns see note 4 sp60 tssl2dov sdox data output valid after ssx edge ? ? 50 ns ? note 1: these parameters are characterized, but are not tested in manufacturing. 2: data in ?typical? column is at 3.3v, +25c unless otherwise stated. 3: the minimum clock period for sckx is 91 ns. therefor e, the sck clock generated by the master must not violate this specification. 4: assumes 50 pf load on all spix pins.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 430 preliminary ? 2011 microchip technology inc. figure 30-20: spi2 slave mode (full-duplex cke = 0 , ckp = 1 , smp = 0 ) timing characteristics ss x sck x (ckp = 0 ) sck x (ckp = 1 ) sdo x sp50 sp40 sp41 sp30,sp31 sp51 sp35 msb lsb bit 14 - - - - - -1 msb in bit 14 - - - -1 lsb in sp52 sp73 sp72 sp72 sp73 sp70 note: refer to figure 30-1 for load conditions. sdi x sp36
? 2011 microchip technology inc. preliminary ds70657d-page 431 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x table 30-41: spi2 slave mo de (full-duplex, cke = 0 , ckp = 1 , smp = 0 ) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param. symbol characteristic (1) min. typ. (2) max. units conditions sp70 tscp maximum sck input frequency ? ? 15 mhz see note 3 sp72 tscf sckx input fall time ? ? ? ns see parameter do32 and note 4 sp73 tscr sckx input rise time ? ? ? ns see parameter do31 and note 4 sp30 tdof sdox data output fall time ? ? ? ns see parameter do32 and note 4 sp31 tdor sdox data output rise time ? ? ? ns see parameter do31 and note 4 sp35 tsch2dov, tscl2dov sdox data output valid after sckx edge ? 6 20 ns ? sp36 tdov2sch, tdov2scl sdox data output setup to first sckx edge 30 ? ? ns ? sp40 tdiv2sch, tdiv2scl setup time of sdix data input to sckx edge 30 ? ? ns ? sp41 tsch2dil, tscl2dil hold time of sdix data input to sckx edge 30 ? ? ns ? sp50 tssl2sch, tssl2scl ssx to sckx or sckx input 120 ? ? ns ? sp51 tssh2doz ssx to sdox output high-impedance (4) 10 ? 50 ns ? sp52 tsch2ssh tscl2ssh ssx after sckx edge 1.5 t cy + 40 ? ? ns see note 4 note 1: these parameters are characterized, but are not tested in manufacturing. 2: data in ?typical? column is at 3.3v, +25c unless otherwise stated. 3: the minimum clock period for sckx is 66.7 ns. ther efore, the sck clock gener ated by the master must not violate this specification. 4: assumes 50 pf load on all spix pins.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 432 preliminary ? 2011 microchip technology inc. figure 30-21: spi2 slave mode (full-duplex, cke = 0 , ckp = 0 , smp = 0 ) timing characteristics ss x sck x (ckp = 0 ) sck x (ckp = 1 ) sdo x sp50 sp40 sp41 sp30,sp31 sp51 sp35 msb lsb bit 14 - - - - - -1 msb in bit 14 - - - -1 lsb in sp52 sp73 sp72 sp72 sp73 sp70 note: refer to figure 30-1 for load conditions. sdi x sp36
? 2011 microchip technology inc. preliminary ds70657d-page 433 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x table 30-42: spi2 slave mo de (full-duplex, cke = 0 , ckp = 0 , smp = 0 ) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param. symbol characteristic (1) min. typ. (2) max. units conditions sp70 tscp maximum sck input frequency ? ? 11 mhz see note 3 sp72 tscf sckx input fall time ? ? ? ns see parameter do32 and note 4 sp73 tscr sckx input rise time ? ? ? ns see parameter do31 and note 4 sp30 tdof sdox data output fall time ? ? ? ns see parameter do32 and note 4 sp31 tdor sdox data output rise time ? ? ? ns see parameter do31 and note 4 sp35 tsch2dov, tscl2dov sdox data output valid after sckx edge ? 6 20 ns ? sp36 tdov2sch, tdov2scl sdox data output setup to first sckx edge 30 ? ? ns ? sp40 tdiv2sch, tdiv2scl setup time of sdix data input to sckx edge 30 ? ? ns ? sp41 tsch2dil, tscl2dil hold time of sdix data input to sckx edge 30 ? ? ns ? sp50 tssl2sch, tssl2scl ssx to sckx or sckx input 120 ? ? ns ? sp51 tssh2doz ssx to sdox output high-impedance (4) 10 ? 50 ns ? sp52 tsch2ssh tscl2ssh ssx after sckx edge 1.5 t cy + 40 ? ? ns see note 4 note 1: these parameters are characterized, but are not tested in manufacturing. 2: data in ?typical? column is at 3.3v, +25c unless otherwise stated. 3: the minimum clock period for sckx is 91 ns. therefor e, the sck clock generated by the master must not violate this specification. 4: assumes 50 pf load on all spix pins.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 434 preliminary ? 2011 microchip technology inc. table 30-43: spi1 maximum data/clock rate summary figure 30-22: spi1 master mode (h alf-duplex, transmit only cke = 0 ) timing characteristics ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended maximum data rate master transmit only (half-duplex) master transmit/receive (full-duplex) slave transmit/receive (full-duplex) cke ckp smp 15 mhz table 30-44 ?? 0 , 10 , 10 , 1 10 mhz ? table 30-45 ? 10 , 11 10 mhz ? table 30-46 ? 00 , 11 15 mhz ? ? table 30-47 100 11 mhz ? ? table 30-48 110 15 mhz ? ? table 30-49 010 11 mhz ? ? table 30-50 000 sckx (ckp = 0 ) sckx (ckp = 1 ) sdox sp10 sp21 sp20 sp35 sp20 sp21 msb lsb bit 14 - - - - - -1 sp30, sp31 sp30, sp31 note: refer to figure 30-1 for load conditions.
? 2011 microchip technology inc. preliminary ds70657d-page 435 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x figure 30-23: spi1 master mode (h alf-duplex, transmit only cke = 1 ) timing characteristics table 30-44: spi1 master mode (half-dupl ex, transmit only) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param. symbol characteristic (1) min. typ. (2) max. units conditions sp10 tscp maximum sck frequency ? ? 15 mhz see note 3 sp20 tscf sckx output fall time ? ? ? ns see parameter do32 and note 4 sp21 tscr sckx output rise time ? ? ? ns see parameter do31 and note 4 sp30 tdof sdox data output fall time ? ? ? ns see parameter do32 and note 4 sp31 tdor sdox data output rise time ? ? ? ns see parameter do31 and note 4 sp35 tsch2dov, tscl2dov sdox data output valid after sckx edge ?620ns ? sp36 tdiv2sch, tdiv2scl sdox data output setup to first sckx edge 30 ? ? ns ? note 1: these parameters are characterized, but are not tested in manufacturing. 2: data in ?typical? column is at 3.3v, +25c unless otherwise stated. 3: the minimum clock period for sckx is 66.7 ns. theref ore, the clock generated in master mode must not violate this specification. 4: assumes 50 pf load on all spix pins. sckx (ckp = 0 ) sckx (ckp = 1 ) sdox sp10 sp21 sp20 sp35 sp20 sp21 msb lsb bit 14 - - - - - -1 sp30, sp31 note: refer to figure 30-1 for load conditions. sp36
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 436 preliminary ? 2011 microchip technology inc. figure 30-24: spi1 master mode (full-duplex, cke = 1 , ckp = x , smp = 1 ) timing characteristics table 30-45: spi1 master mode (full-duplex, cke = 1 , ckp = x , smp = 1 ) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param. symbol characteristic (1) min. typ. (2) max. units conditions sp10 tscp maximum sck frequency ? ? 10 mhz see note 3 sp20 tscf sckx output fall time ? ? ? ns see parameter do32 and note 4 sp21 tscr sckx output rise time ? ? ? ns see parameter do31 and note 4 sp30 tdof sdox data output fall time ? ? ? ns see parameter do32 and note 4 sp31 tdor sdox data output rise time ? ? ? ns see parameter do31 and note 4 sp35 tsch2dov, tscl2dov sdox data output valid after sckx edge ? 6 20 ns ? sp36 tdov2sc, tdov2scl sdox data output setup to first sckx edge 30 ? ? ns ? sp40 tdiv2sch, tdiv2scl setup time of sdix data input to sckx edge 30 ? ? ns ? sp41 tsch2dil, tscl2dil hold time of sdix data input to sckx edge 30 ? ? ns ? note 1: these parameters are characterized, but are not tested in manufacturing. 2: data in ?typical? column is at 3.3v, +25c unless otherwise stated. 3: the minimum clock period for sckx is 100 ns. the cl ock generated in master mode must not violate this specification. 4: assumes 50 pf load on all spix pins. sckx (ckp = 0 ) sckx (ckp = 1 ) sdox sp10 sp21 sp20 sp35 sp20 sp21 msb lsb bit 14 - - - - - -1 sp30, sp31 note: refer to figure 30-1 for load conditions. sp36 sp41 msb in lsb in bit 14 - - - -1 sdix sp40
? 2011 microchip technology inc. preliminary ds70657d-page 437 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x figure 30-25: spi1 master mode (full-duplex, cke = 0 , ckp = x , smp = 1 ) timing characteristics table 30-46: spi1 master mo de (full-duplex, cke = 0 , ckp = x , smp = 1 ) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param. symbol characteristic (1) min. typ. (2) max. units conditions sp10 tscp maximum sck frequency ? ? 10 mhz -40oc to +125oc and see note 3 sp20 tscf sckx output fall time ? ? ? ns see parameter do32 and note 4 sp21 tscr sckx output rise time ? ? ? ns see parameter do31 and note 4 sp30 tdof sdox data output fall time ? ? ? ns see parameter do32 and note 4 sp31 tdor sdox data output rise time ? ? ? ns see parameter do31 and note 4 sp35 tsch2dov, tscl2dov sdox data output valid after sckx edge ? 6 20 ns ? sp36 tdov2sch, tdov2scl sdox data output setup to first sckx edge 30 ? ? ns ? sp40 tdiv2sch, tdiv2scl setup time of sdix data input to sckx edge 30 ? ? ns ? sp41 tsch2dil, tscl2dil hold time of sdix data input to sckx edge 30 ? ? ns ? note 1: these parameters are characterized, but are not tested in manufacturing. 2: data in ?typical? column is at 3.3v, +25c unless otherwise stated. 3: the minimum clock period for sckx is 100 ns. the cl ock generated in master mo de must not violate this specification. 4: assumes 50 pf load on all spix pins. sckx (ckp = 0 ) sckx (ckp = 1 ) sdox sdix sp10 sp40 sp41 sp21 sp20 sp35 sp20 sp21 msb lsb bit 14 - - - - - -1 msb in lsb in bit 14 - - - -1 sp30, sp31 sp30, sp31 note: refer to figure 30-1 for load conditions. sp36
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 438 preliminary ? 2011 microchip technology inc. figure 30-26: spi1 slave mode (full-duplex, cke = 1 , ckp = 0 , smp = 0 ) timing characteristics ssx sckx (ckp = 0 ) sckx (ckp = 1 ) sdox sdi sp50 sp60 sdix sp30,sp31 msb bit 14 - - - - - -1 lsb sp51 msb in bit 14 - - - -1 lsb in sp35 sp52 sp73 sp72 sp72 sp73 sp70 sp40 sp41 note: refer to figure 30-1 for load conditions. sp36
? 2011 microchip technology inc. preliminary ds70657d-page 439 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x table 30-47: spi1 slave mo de (full-duplex, cke = 1 , ckp = 0 , smp = 0 ) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param. symbol characteristic (1) min. typ. (2) max. units conditions sp70 tscp maximum sck input frequency ? ? 15 mhz see note 3 sp72 tscf sckx input fall time ? ? ? ns see parameter do32 and note 4 sp73 tscr sckx input rise time ? ? ? ns see parameter do31 and note 4 sp30 tdof sdox data output fall time ? ? ? ns see parameter do32 and note 4 sp31 tdor sdox data output rise time ? ? ? ns see parameter do31 and note 4 sp35 tsch2dov, tscl2dov sdox data output valid after sckx edge ? 6 20 ns ? sp36 tdov2sch, tdov2scl sdox data output setup to first sckx edge 30 ? ? ns ? sp40 tdiv2sch, tdiv2scl setup time of sdix data input to sckx edge 30 ? ? ns ? sp41 tsch2dil, tscl2dil hold time of sdix data input to sckx edge 30 ? ? ns ? sp50 tssl2sch, tssl2scl ssx to sckx or sckx input 120 ? ? ns ? sp51 tssh2doz ssx to sdox output high-impedance (4) 10 ? 50 ns ? sp52 tsch2ssh tscl2ssh ssx after sckx edge 1.5 t cy + 40 ? ? ns see note 4 sp60 tssl2dov sdox data output valid after ssx edge ? ? 50 ns ? note 1: these parameters are characterized, but are not tested in manufacturing. 2: data in ?typical? column is at 3.3v, +25c unless otherwise stated. 3: the minimum clock period for sckx is 66.7 ns. ther efore, the sck clock gener ated by the master must not violate this specification. 4: assumes 50 pf load on all spix pins.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 440 preliminary ? 2011 microchip technology inc. figure 30-27: spi1 slave mode (full-duplex, cke = 1 , ckp = 1 , smp = 0 ) timing characteristics ssx sckx (ckp = 0 ) sckx (ckp = 1 ) sdox sdi sp50 sp60 sdix sp30,sp31 msb bit 14 - - - - - -1 lsb sp51 msb in bit 14 - - - -1 lsb in sp35 sp52 sp73 sp72 sp72 sp73 sp70 sp40 sp41 note: refer to figure 30-1 for load conditions. sp36
? 2011 microchip technology inc. preliminary ds70657d-page 441 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x table 30-48: spi1 slave mo de (full-duplex, cke = 1 , ckp = 1 , smp = 0 ) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param. symbol characteristic (1) min. typ. (2) max. units conditions sp70 tscp maximum sck input frequency ? ? 11 mhz see note 3 sp72 tscf sckx input fall time ? ? ? ns see parameter do32 and note 4 sp73 tscr sckx input rise time ? ? ? ns see parameter do31 and note 4 sp30 tdof sdox data output fall time ? ? ? ns see parameter do32 and note 4 sp31 tdor sdox data output rise time ? ? ? ns see parameter do31 and note 4 sp35 tsch2dov, tscl2dov sdox data output valid after sckx edge ? 6 20 ns ? sp36 tdov2sch, tdov2scl sdox data output setup to first sckx edge 30 ? ? ns ? sp40 tdiv2sch, tdiv2scl setup time of sdix data input to sckx edge 30 ? ? ns ? sp41 tsch2dil, tscl2dil hold time of sdix data input to sckx edge 30 ? ? ns ? sp50 tssl2sch, tssl2scl ssx to sckx or sckx input 120 ? ? ns ? sp51 tssh2doz ssx to sdox output high-impedance (4) 10 ? 50 ns ? sp52 tsch2ssh, tscl2ssh ssx after sckx edge 1.5 t cy + 40 ? ? ns see note 4 sp60 tssl2dov sdox data output valid after ssx edge ? ? 50 ns ? note 1: these parameters are characterized, but are not tested in manufacturing. 2: data in ?typical? column is at 3.3v, +25c unless otherwise stated. 3: the minimum clock period for sckx is 91 ns. therefor e, the sck clock generated by the master must not violate this specification. 4: assumes 50 pf load on all spix pins.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 442 preliminary ? 2011 microchip technology inc. figure 30-28: spi1 slave mode (full-duplex cke = 0 , ckp = 1 , smp = 0 ) timing characteristics ss x sck x (ckp = 0 ) sck x (ckp = 1 ) sdo x sp50 sp40 sp41 sp30,sp31 sp51 sp35 msb lsb bit 14 - - - - - -1 msb in bit 14 - - - -1 lsb in sp52 sp73 sp72 sp72 sp73 sp70 note: refer to figure 30-1 for load conditions. sdi x sp36
? 2011 microchip technology inc. preliminary ds70657d-page 443 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x table 30-49: spi1 slave mo de (full-duplex, cke = 0 , ckp = 1 , smp = 0 ) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param. symbol characteristic (1) min. typ. (2) max. units conditions sp70 tscp maximum sck input frequency ? ? 15 mhz see note 3 sp72 tscf sckx input fall time ? ? ? ns see parameter do32 and note 4 sp73 tscr sckx input rise time ? ? ? ns see parameter do31 and note 4 sp30 tdof sdox data output fall time ? ? ? ns see parameter do32 and note 4 sp31 tdor sdox data output rise time ? ? ? ns see parameter do31 and note 4 sp35 tsch2dov, tscl2dov sdox data output valid after sckx edge ? 6 20 ns ? sp36 tdov2sch, tdov2scl sdox data output setup to first sckx edge 30 ? ? ns ? sp40 tdiv2sch, tdiv2scl setup time of sdix data input to sckx edge 30 ? ? ns ? sp41 tsch2dil, tscl2dil hold time of sdix data input to sckx edge 30 ? ? ns ? sp50 tssl2sch, tssl2scl ssx to sckx or sckx input 120 ? ? ns ? sp51 tssh2doz ssx to sdox output high-impedance (4) 10 ? 50 ns ? sp52 tsch2ssh, tscl2ssh ssx after sckx edge 1.5 t cy + 40 ? ? ns see note 4 note 1: these parameters are characterized, but are not tested in manufacturing. 2: data in ?typical? column is at 3.3v, +25c unless otherwise stated. 3: the minimum clock period for sckx is 66.7 ns. ther efore, the sck clock gener ated by the master must not violate this specification. 4: assumes 50 pf load on all spix pins.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 444 preliminary ? 2011 microchip technology inc. figure 30-29: spi1 slave mode (full-duplex, cke = 0 , ckp = 0 , smp = 0 ) timing characteristics ss x sck x (ckp = 0 ) sck x (ckp = 1 ) sdo x sp50 sp40 sp41 sp30,sp31 sp51 sp35 msb lsb bit 14 - - - - - -1 msb in bit 14 - - - -1 lsb in sp52 sp73 sp72 sp72 sp73 sp70 note: refer to figure 30-1 for load conditions. sdi x sp36
? 2011 microchip technology inc. preliminary ds70657d-page 445 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x table 30-50: spi1 slave mo de (full-duplex, cke = 0 , ckp = 0 , smp = 0 ) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param. symbol characteristic (1) min. typ. (2) max. units conditions sp70 tscp maximum sck input frequency ? ? 11 mhz see note 3 sp72 tscf sckx input fall time ? ? ? ns see parameter do32 and note 4 sp73 tscr sckx input rise time ? ? ? ns see parameter do31 and note 4 sp30 tdof sdox data output fall time ? ? ? ns see parameter do32 and note 4 sp31 tdor sdox data output rise time ? ? ? ns see parameter do31 and note 4 sp35 tsch2dov, tscl2dov sdox data output valid after sckx edge ? 6 20 ns ? sp36 tdov2sch, tdov2scl sdox data output setup to first sckx edge 30 ? ? ns ? sp40 tdiv2sch, tdiv2scl setup time of sdix data input to sckx edge 30 ? ? ns ? sp41 tsch2dil, tscl2dil hold time of sdix data input to sckx edge 30 ? ? ns ? sp50 tssl2sch, tssl2scl ssx to sckx or sckx input 120 ? ? ns ? sp51 tssh2doz ssx to sdox output high-impedance (4) 10 ? 50 ns ? sp52 tsch2ssh, tscl2ssh ssx after sckx edge 1.5 t cy + 40 ? ? ns see note 4 note 1: these parameters are characterized, but are not tested in manufacturing. 2: data in ?typical? column is at 3.3v, +25c unless otherwise stated. 3: the minimum clock period for sckx is 91 ns. therefor e, the sck clock generated by the master must not violate this specification. 4: assumes 50 pf load on all spix pins.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 446 preliminary ? 2011 microchip technology inc. figure 30-30: i2cx bus start/stop bits timing characteristics (master mode) figure 30-31: i2cx bus data timing characteristics (master mode) im31 im34 sclx sdax start condition stop condition im30 im33 note: refer to figure 30-1 for load conditions. im11 im10 im33 im11 im10 im20 im26 im25 im40 im40 im45 im21 sclx sdax in sdax out note: refer to figure 30-1 for load conditions.
? 2011 microchip technology inc. preliminary ds70657d-page 447 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x table 30-51: i2cx bus data timing requirements (master mode) ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. symbol characteristic min. (1) max. units conditions im10 t lo : scl clock low time 100 khz mode t cy /2 (brg + 2) ? s? 400 khz mode t cy /2 (brg + 2) ? s? 1 mhz mode (2) t cy /2 (brg + 2) ? s? im11 t hi : scl clock high time 100 khz mode t cy /2 (brg + 2) ? s? 400 khz mode t cy /2 (brg + 2) ? s? 1 mhz mode (2) t cy /2 (brg + 2) ? s? im20 t f : scl sdax and sclx fall time 100 khz mode ? 300 ns c b is specified to be from 10 to 400 pf 400 khz mode 20 + 0.1 c b 300 ns 1 mhz mode (2) ? 100 ns im21 t r : scl sdax and sclx rise time 100 khz mode ? 1000 ns c b is specified to be from 10 to 400 pf 400 khz mode 20 + 0.1 c b 300 ns 1 mhz mode (2) ? 300 ns im25 t su : dat data input setup time 100 khz mode 250 ? ns ? 400 khz mode 100 ? ns 1 mhz mode (2) 40 ? ns im26 t hd : dat data input hold time 100 khz mode 0 ? s? 400 khz mode 0 0.9 s 1 mhz mode (2) 0.2 ? s im30 t su : sta start condition setup time 100 khz mode t cy /2 (brg + 2) ? s only relevant for repeated start condition 400 khz mode t cy /2 (brg + 2) ? s 1 mhz mode (2) t cy /2 (brg + 2) ? s im31 t hd : sta start condition hold time 100 khz mode t cy /2 (brg + 2) ? s after this period the first clock pulse is generated 400 khz mode t cy /2 (brg +2) ? s 1 mhz mode (2) t cy /2 (brg + 2) ? s im33 t su : sto stop condition setup time 100 khz mode t cy /2 (brg + 2) ? s? 400 khz mode t cy /2 (brg + 2) ? s 1 mhz mode (2) t cy /2 (brg + 2) ? s im34 t hd : sto stop condition 100 khz mode t cy /2 (brg + 2) ? s? hold time 400 khz mode t cy /2 (brg + 2) ? s 1 mhz mode (2) t cy /2 (brg + 2) ? s im40 t aa : scl output valid from clock 100 khz mode ? 3500 ns ? 400 khz mode ? 1000 ns ? 1 mhz mode (2) ? 400 ns ? im45 t bf : sda bus free time 100 khz mode 4.7 ? s time the bus must be free before a new transmission can start 400 khz mode 1.3 ? s 1 mhz mode (2) 0.5 ? s im50 c b bus capacitive loading ? 400 pf ? im51 t pgd pulse gobbler delay 65 390 ns see note 3 note 1: brg is the value of the i 2 c baud rate generator. refer to section 19. ?inter-integrated circuit (i 2 c?)? (ds70330) in the ? dspic33e/pic24e family reference manual?. please see the microchip web site for the latest family reference manual sections. 2: maximum pin capacitance = 10 pf for all i2cx pins (for 1 mhz mode only). 3: typical value for this parameter is 130 ns. 4: these parameters are characterized, but not tested in manufacturing.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 448 preliminary ? 2011 microchip technology inc. figure 30-32: i2cx bus start/stop bits timing characteristics (slave mode) figure 30-33: i2cx bus data timing characteristics (slave mode) is31 is34 sclx sdax start condition stop condition is30 is33 is30 is31 is33 is11 is10 is20 is25 is40 is40 is45 is21 sclx sdax in sdax out is26
? 2011 microchip technology inc. preliminary ds70657d-page 449 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x table 30-52: i2cx bus data timing requirements (slave mode) ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param. no. symbol characteristic min. max. units conditions is10 t lo : scl clock low time 100 khz mode 4.7 ? s ? 400 khz mode 1.3 ? s? 1 mhz mode (1) 0.5 ? s? is11 t hi : scl clock high time 100 khz mode 4.0 ? s device must operate at a minimum of 1.5 mhz 400 khz mode 0.6 ? s device must operate at a minimum of 10 mhz 1 mhz mode (1) 0.5 ? s? is20 t f : scl sdax and sclx fall time 100 khz mode ? 300 ns c b is specified to be from 10 to 400 pf 400 khz mode 20 + 0.1 c b 300 ns 1 mhz mode (1) ?100ns is21 t r : scl sdax and sclx rise time 100 khz mode ? 1000 ns c b is specified to be from 10 to 400 pf 400 khz mode 20 + 0.1 c b 300 ns 1 mhz mode (1) ?300ns is25 t su : dat data input setup time 100 khz mode 250 ? ns ? 400 khz mode 100 ? ns 1 mhz mode (1) 100 ? ns is26 t hd : dat data input hold time 100 khz mode 0 ? s? 400 khz mode 0 0.9 s 1 mhz mode (1) 00.3 s is30 t su : sta start condition setup time 100 khz mode 4.7 ? s only relevant for repeated start condition 400 khz mode 0.6 ? s 1 mhz mode (1) 0.25 ? s is31 t hd : sta start condition hold time 100 khz mode 4.0 ? s after this period, the first clock pulse is generated 400 khz mode 0.6 ? s 1 mhz mode (1) 0.25 ? s is33 t su : sto stop condition setup time 100 khz mode 4.7 ? s? 400 khz mode 0.6 ? s 1 mhz mode (1) 0.6 ? s is34 t hd : sto stop condition hold time 100 khz mode 4 ? s? 400 khz mode 0.6 ? s 1 mhz mode (1) 0.25 s is40 t aa : scl output valid from clock 100 khz mode 0 3500 ns ? 400 khz mode 0 1000 ns 1 mhz mode (1) 0350ns is45 t bf : sda bus free time 100 khz mode 4.7 ? s time the bus must be free before a new transmission can start 400 khz mode 1.3 ? s 1 mhz mode (1) 0.5 ? s is50 c b bus capacitive loading ? 400 pf ? is51 t pgd pulse gobbler delay 65 390 ns see note 2 note 1: maximum pin capacitance = 10 pf for all i2cx pins (for 1 mhz mode only). 2: the typical value for this parameter is 130 ns. 3: these parameters are characterized, but not tested in manufacturing.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 450 preliminary ? 2011 microchip technology inc. figure 30-34: ecan module i/o timing characteristics table 30-53: ecan module i/o timing requirements figure 30-35: uart module i/o timing characteristics table 30-54: uart module i/o timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. symbol characteristic (1) min. typ. (2) max. units conditions ca10 tiof port output fall time ? ? ? ns see parameter do32 ca11 tior port output rise time ? ? ? ns see parameter do31 ca20 tcwf pulse width to trigger can wake-up filter 120 ? ? ns ? note 1: these parameters are characterized but not tested in manufacturing. 2: data in ?typical? column is at 3.3v, +25c unle ss otherwise stated. parameters are for design guidance only and are not tested. ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +125c param no. symbol characteristic (1) min. typ. (2) max. units conditions ua10 tuabaud uart baud time 66.67 ? ? ns ? ua11 fbaud uart baud frequency ? ? 15 mbps ? ua20 tcwf start bit pulse width to trigger uart wake-up 500 ? ? ns ? note 1: these parameters are characterized but not tested in manufacturing. 2: data in ?typical? column is at 3.3v, +25c unle ss otherwise stated. parameters are for design guidance only and are not tested. citx pin (output) ca10 ca11 old value new value ca20 cirx pin (input) ua20 uirx msb in lsb in bit 6-1 ua10 u i tx
? 2011 microchip technology inc. preliminary ds70657d-page 451 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x table 30-55: ctmu current source specifications dc characteristics standard oper ating conditions:3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. symbol characteristic min. typ. max. units conditions ctmu c urrent s ource ctmui1 i out 1 base range (1) ? 0.65 ? a ctmuicon<9:8> = 01 ctmui2 i out 2 10x range (1) ? 6.5 ? a ctmuicon<9:8> = 10 ctmui3 i out 3 100x range (1) ? 65 ? a ctmuicon<9:8> = 11 ctmui4 i out 4 1000x range (1) ? 580 ? a ctmuicon<9:8> = 00 ctmufv1 v f temperature diode forward voltage (1,2) ?0.598? vt a = +25oc, ctmuicon<9:8> = 01 ?0.658? vt a = +25oc, ctmuicon<9:8> = 10 ?0.721? vt a = +25oc, ctmuicon<9:8> = 11 ctmufv2 v fvr temperature diode rate of change (1,2) ? -1.92 ? mv/oc ctmuicon<9:8> = 01 ? -1.74 ? mv/oc ctmuicon<9:8> = 10 ? -1.56 ? mv/oc ctmuicon<9:8> = 11 note 1: nominal value at center point of cu rrent trim range (ctmuicon<15:10> = 000000 ). 2: parameters are characterized but not tested in manu facturing. measurements taken with the following conditions: ?v ref + = av dd = 3.3v ? adc configured for 10-bit mode ? adc module configured for conversion speed of 500 ksps ? all pmd bits are cleared (pmdx = 0 ) ? executing a while(1) statement ? device operating from the frc with no pll
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 452 preliminary ? 2011 microchip technology inc. table 30-56: adc module specifications ac characteristics standard operating conditions (see note 1): 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. symbol characteristic min. typ. max. units conditions device supply ad01 av dd module v dd supply greater of v dd ? 0.3 or 3.0 ? lesser of v dd + 0.3 or 3.6 v ? ad02 av ss module v ss supply v ss ? 0.3 ? v ss + 0.3 v ? reference inputs ad05 v refh reference voltage high av ss + 2.5 ? av dd v see note 1 v refh = v ref + v refl = v ref - ad05a 3.0 ? 3.6 v v refh = av dd v refl = av ss = 0 ad06 v refl reference voltage low av ss ?av dd ? 2.5 v see note 1 ad06a 0 ? 0 v v refh = av dd v refl = av ss = 0 ad07 v ref absolute reference voltage 2.5 ? 3.6 v v ref = v refh - v refl ad08 i ref current drain ? ? ? ? 10 600 a a adc off adc on ad09 i ad operating current ? ? 5 2 ? ? ma ma adc operating in 10-bit mode, see note 1 adc operating in 12-bit mode, see note 1 analog input ad12 v inh input voltage range v inh v inl ?v refh v this voltage reflects sample and hold channels 0, 1, 2, and 3 (ch0-ch3), positive input ad13 v inl input voltage range v inl v refl ?av ss + 1v v this voltage reflects sample and hold channels 0, 1, 2, and 3 (ch0-ch3), negative input ad17 r in recommended imped- ance of analog voltage source ? ? 200 impedance to achieve maximum performance of adc note 1: device is functional at v bormin < v dd < v ddmin , but will have degraded performance. device functionality is tested, but not characterized. analog modules: adc, op amp/comparator, and comparator voltage reference, will have degraded performance. refer to parameter bo10 in table 30-12 for the minimum and maximum bor values.
? 2011 microchip technology inc. preliminary ds70657d-page 453 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x table 30-57: adc module specifications (12-bit mode) ac characteristics standard operating conditions (see note 1): 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. symbol characteristic min. typ. max. units conditions adc accuracy (12-bit mode) ? measurements with external v ref +/v ref - ad20a nr resolution 12 data bits bits ? ad21a inl integral nonlinearity -2 ? +2 lsb v inl = av ss = v refl = 0v, av dd = v refh = 3.6v ad22a dnl differential nonlinearity >-1 ? <1 lsb v inl = av ss = v refl = 0v, av dd = v refh = 3.6v ad23a g err gain error 1.25 1.5 3 lsb v inl = av ss = v refl = 0v, av dd = v refh = 3.6v ad24a e off offset error 1.25 1.52 2 lsb v inl = av ss = v refl = 0v, av dd = v refh = 3.6v ad25a ? monotonicity ? ? ? ? guaranteed adc accuracy (12-bit mode) ? measurements with internal v ref +/v ref - ad20a nr resolution 12 data bits bits ? ad21a inl integral nonlinearity -2 ? +2 lsb v inl = av ss = 0v, av dd = 3.6v ad22a dnl differential nonlinearity >-1 ? <1 lsb v inl = av ss = 0v, av dd = 3.6v ad23a g err gain error 2 3 7 lsb v inl = av ss = 0v, av dd = 3.6v ad24a e off offset error 2 3 5 lsb v inl = av ss = 0v, av dd = 3.6v ad25a ? monotonicity ? ? ? ? guaranteed dynamic performance (12-bit mode) ad30a thd total harmonic distortion ? ? -75 db ? ad31a sinad signal to noise and distortion 68.5 69.5 ? db ? ad32a sfdr spurious free dynamic range 80 ? ? db ? ad33a f nyq input signal bandwidth ? ? 250 khz ? ad34a enob effective number of bits 11.09 11.3 ? bits ? note 1: device is functional at v bormin < v dd < v ddmin , but will have degraded performance. device functionality is tested, but not characterized. analog modules: adc, op amp/comparator, and comparator voltage reference, will have degraded performance. refer to parameter bo10 in table 30-12 for the minimum and maximum bor values.
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 454 preliminary ? 2011 microchip technology inc. table 30-58: adc module specifications (10-bit mode) ac characteristics standard operating conditions (see note 1): 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. symbol characteristic min. typ. max. units conditions adc accuracy (10-bit mode) ? measurements with external v ref +/v ref - ad20b nr resolution 10 data bits bits ? ad21b inl integral nonlinearity -1.5 ? +1.5 lsb v inl = av ss = v refl = 0v, av dd = v refh = 3.6v ad22b dnl differential nonlinearity >-1 ? <1 lsb v inl = av ss = v refl = 0v, av dd = v refh = 3.6v ad23b g err gain error 1 3 6 lsb v inl = av ss = v refl = 0v, av dd = v refh = 3.6v ad24b e off offset error 1 2 3 lsb v inl = av ss = v refl = 0v, av dd = v refh = 3.6v ad25b ? monotonicity ? ? ? ? guaranteed adc accuracy (10-bit mode) ? measurements with internal v ref +/v ref - ad20b nr resolution 10 data bits bits ? ad21b inl integral nonlinearity -1.5 ? +1.5 lsb v inl = av ss = 0v, av dd = 3.6v ad22b dnl differential nonlinearity >-1 ? <1 lsb v inl = av ss = 0v, av dd = 3.6v ad23b g err gain error 1 5 6 lsb v inl = av ss = 0v, av dd = 3.6v ad24b e off offset error 1 2 5 lsb v inl = av ss = 0v, av dd = 3.6v ad25b ? monotonicity ? ? ? ? guaranteed dynamic performance (10-bit mode) ad30b thd total harmonic distortion ? ? -64 db ? ad31b sinad signal to noise and distortion 57 58.5 ? db ? ad32b sfdr spurious free dynamic range 72 ? ? db ? ad33b f nyq input signal bandwidth ? ? 550 khz ? ad34b enob effective number of bits 9.16 9.4 ? bits ? note 1: device is functional at v bormin < v dd < v ddmin , but will have degraded performance. device functionality is tested, but not characterized. analog modules: adc, op amp/comparator, and comparator voltage reference, will have degraded performance. refer to parameter bo10 in table 30-12 for the minimum and maximum bor values.
? 2011 microchip technology inc. preliminary ds70657d-page 455 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x figure 30-36: adc conversion (12-bit mode) timing characteristics (asam = 0 , ssrc<2:0> = 000 , ssrcg = 0 ) ad55 t samp clear samp set samp ad61 adclk instruction samp ad60 done ad1if 1 2 3 4 5 6 8 7 1 ? software sets ad1con1. samp to start sampling. 2 ? sampling starts after discharge period. t samp is described in 3 ? software clears ad1con1. samp to start conversion. 4 ? sampling ends, conversion sequence starts. 5 ? convert bit 11. 9 ? one t ad for end of conversion. ad50 9 6 ? convert bit 10. 7 ? convert bit 1. 8 ? convert bit 0. execution ?dspic33e/pic24e family reference manual? . section 16. ?analog-to-digital converter (adc)? (ds70621) of the
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 456 preliminary ? 2011 microchip technology inc. table 30-59: adc conversion (12- bit mode) timing requirements ac characteristics standard operating conditions (see note 2): 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. symbol characteristic min. typ. max. units conditions clock parameters ad50 t ad adc clock period 117.6 ? ? ns ? ad51 t rc adc internal rc oscillator period ? 250 ? ns ? conversion rate ad55 t conv conversion time ? 14 t ad ns ? ad56 f cnv throughput rate ? ? 500 ksps ? ad57a t samp sample time when sampling any anx input 3 t ad ?? ? ? ad57b t samp sample time when sampling the op amp outputs (configuration a (4) and configuration b (5) ) 3 t ad ?? ? ? timing parameters ad60 t pcs conversion start from sample trigger (6) 2 t ad ?3 t ad ? auto convert trigger not selected ad61 t pss sample start from setting sample (samp) bit (6) 2 t ad ?3 t ad ?? ad62 t css conversion completion to sample start (asam = 1 ) (6) ? 0.5 t ad ?? ? ad63 t dpu time to stabilize analog stage from adc off to adc on (6) ??20 s see note 3 note 1: because the sample caps will eventually lose charge, clock rates below 10 khz may affect linearity performance, especially at elevated temperatures. 2: device is functional at v bormin < v dd < v ddmin , but will have degraded performance. device functionality is tested, but not characterized. analog modules: adc, op amp/comparator, and comparator voltage reference, will have degraded performance. refer to parameter bo10 in table 30-12 for the minimum and maximum bor values. 3: the parameter t dpu is the time required for the adc module to stabilize at the appropriate level when the module is turned on (adon (ad1con1<15>) = ? 1 ?). during this ti me, the adc result is indeterminate. 4: see figure 25-5 for configuration information. 5: see figure 25-6 for configuration information. 6: these parameters are characterized, but not tested in manufacturing.
? 2011 microchip technology inc. preliminary ds70657d-page 457 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x figure 30-37: adc conversion (10-bit mode) timing characteristics (chps<1:0> = 01 , simsam = 0 , asam = 0 , ssrc<2:0> = 000 , ssrcg = 0 ) figure 30-38: adc conversion (10-bit mode) timing characteristics (chps<1:0> = 01 , simsam = 0 , asam = 1 , ssrc<2:0> = 111 , ssrcg = 0 , samc<4:0> = 00010 ) ad55 t samp clear samp set samp ad61 adclk instruction samp ad60 done ad1if 1 2 3 4 5 6 8 5 6 7 1 ? software sets ad1con1. samp to start sampling. 2 ? sampling starts after discharge period. t samp is described in 3 ? software clears ad1con1. samp to start conversion. 4 ? sampling ends, conversion sequence starts. 5 ? convert bit 9. 8 ? one t ad for end of conversion. ad50 7 ad55 8 6 ? convert bit 8. 7 ? convert bit 0. execution ?dspic33e/pic24e family reference manual? . section 16. ?analog-to-digital converter (adc)? (ds70621) of the 1 2 3 4 5 6 4 5 6 8 1 ? software sets ad1con1. adon to start ad operation. 2 ? sampling starts after discharge period. t samp is described in 3 ? convert bit 9. 4 ? convert bit 8. 5 ? convert bit 0. 7 3 6 ? one t ad for end of conversion. 7 ? begin conversion of next channel. 8 ? sample for time specified by samc<4:0>. adclk instruction set adon execution samp t samp ad1if done ad55 ad55 t samp ad55 ad50 section 16. ?analog-to-digital converter (adc)? (ds70621) of the ?dspic33e/pic24e family reference manual? . ad62
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 458 preliminary ? 2011 microchip technology inc. table 30-60: adc conversion (10- bit mode) timing requirements ac characteristics standard operating conditions (see note 1): 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. symbol characteristic min. typ. (1) max. units conditions clock parameters ad50 t ad adc clock period 76 ? ? ns ? ad51 t rc adc internal rc oscillator period ? 250 ? ns ? conversion rate ad55 t conv conversion time ? 12 t ad ?? ? ad56 f cnv throughput rate ? ? 1.1 msps using simultaneous sampling ad57a t samp sample time when sampling any anx input 2 t ad ??? ? ad57b t samp sample time when sampling the op amp outputs (configuration a (4) and configuration b (5) ) 4 t ad ??? ? timing parameters ad60 t pcs conversion start from sample trigger (6) 2 t ad ?3 t ad ? auto-convert trigger not selected ad61 t pss sample start from setting sample (samp) bit (6) 2 t ad ?3 t ad ?? ad62 t css conversion completion to sample start (asam = 1 ) (6) ? 0.5 t ad ?? ? ad63 t dpu time to stabilize analog stage from adc off to adc on (6) ??20 s see note 3 note 1: device is functional at v bormin < v dd < v ddmin , but will have degraded performance. device functionality is tested, but not characterized. analog modules: adc, op amp/comparator, and comparator voltage reference, will have degraded performance. refer to parameter bo10 in table 30-12 for the minimum and maximum bor values. 2: because the sample caps will eventually lose charge, clock rates below 10 khz may affect linearity performance, especially at elevated temperatures. 3: the parameter t dpu is the time required for the adc module to stabilize at the appropriate level when the module is turned on (ad1con1 = 1 ). during this time, the adc result is indeterminate. 4: see figure 25-5 for configuration information. 5: see figure 25-6 for configuration information. 6: these parameters are characterized, but not tested in manufacturing. table 30-61: dma module timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c t a +85c for industrial -40c t a +125c for extended param no. characteristic min. typ. max. units conditions dm1 dma byte/word transfer latency 1 t cy (2) ??ns ? note 1: these parameters are characterized, but not tested in manufacturing. 2: because dma transfers use the cpu data bus, this time is dependent on other functions on the bus.
? 2011 microchip technology inc. preliminary ds70657d-page 459 DSPIC33EPXXXGP50X, dspi c33epxxxmc20x/50x, and pic24epxxxgp/mc20x 31.0 dc and ac device characteristics graphs figure 31-1: v oh ? 4x driver pins figure 31-2: v oh ? 8x driver pins figure 31-3: v ol ? 4x driver pins figure 31-4: v ol ? 8x driver pins note: the graphs provided following this note ar e a statistical summary based on a limited number of samples and are provided for des ign guidance purposes only. the performance characteristics listed herein are not test ed or guaranteed. in some graphs, the data presented may be out side the specified operating range (e.g., outside specified power supply rang e) and therefore, outsi de the warranted range. -0.050 -0.045 -0.040 -0.035 -0.030 -0.025 -0.020 ioh(a) voh (v) -0.050 -0.045 -0.040 -0.035 -0.030 -0.025 -0.020 -0.015 -0.010 -0.005 0.000 0.00 0.50 1.00 1.50 2.00 2.50 3.00 3.50 4.00 ioh(a) voh (v) 3v 3.3v 3.6v absolute maximum -0.080 -0.070 -0.060 -0.050 -0.040 0 030 ioh(a) voh(v) -0.080 -0.070 -0.060 -0.050 -0.040 -0.030 -0.020 -0.010 0.000 0.00 0.50 1.00 1.50 2.00 2.50 3.00 3.50 4.00 ioh(a) voh(v) v v v a 0.015 0.020 0.025 0.030 0.035 0.040 0.045 0.050 ioh(a) vol(v) 0.000 0.005 0.010 0.015 0.020 0.025 0.030 0.035 0.040 0.045 0.050 0.00 0.50 1.00 1.50 2.00 2.50 3.00 3.50 4.00 ioh(a) vol(v) v v v a 0020 0.030 0.040 0.050 0.060 0.070 0.080 ioh(a) vol(v) 8x 0.000 0.010 0.020 0.030 0.040 0.050 0.060 0.070 0.080 0.00 0.50 1.00 1.50 2.00 2.50 3.00 3.50 4.00 ioh(a) vol(v) 8x v v v a
DSPIC33EPXXXGP50X, dspic33epxxxm c20x/50x, and pi c24epxxxgp/mc20x ds70657d-page 460 preliminary ? 2011 microchip technology inc. figure 31-5: typical i pd current @ v dd = 3.3v figure 31-6: typical i dd current @ v dd = 3.3v figure 31-7: typical i doze current @ v dd = 3.3v figure 31-8: typical i idle current @ v dd = 3.3v 200.00 300.00 400.00 500.00 600.00 700.00 800.00 i pd current (a) 0.00 100.00 200.00 300.00 400.00 500.00 600.00 700.00 800.00 -40-30-20-10 0 102030405060708090100110120 i pd current (a) temperature (celsius) 15.00 20.00 25.00 30.00 35.00 40.00 45.00 average (ma) 0.00 5.00 10.00 15.00 20.00 25.00 30.00 35.00 40.00 45.00 0 10203040506070 average (ma) mips i dd (ec+pll) i dd (ec) 15.00 20.00 25.00 30.00 35.00 40.00 45.00 o ze current (ma) 0.00 5.00 10.00 15.00 20.00 25.00 30.00 35.00 40.00 45.00 1:1 1:2 1:4 1:8 1:16 1:32 1:64 1:128 i doze current (ma) doze ratio 10.00 15.00 20.00 25.00 idle current (ma) 0.00 5.00 10.00 15.00 20.00 25.00 0 10203040506070 i idle current (ma) mips i idle (ec) i idle (ec+pll)
? 2011 microchip technology inc. preliminary ds70657d-page 461 DSPIC33EPXXXGP50X, dspi c33epxxxmc20x/50x, and pic24epxxxgp/mc20x figure 31-9: typical frc frequency @ v dd = 3.3v figure 31-10: typical lprc frequency @ v dd = 3.3v figure 31-11: typical ctmu temperature diode forward voltage 7310 7320 7330 7340 7350 7360 7370 7380 frc frequency (khz) 7280 7290 7300 7310 7320 7330 7340 7350 7360 7370 7380 -40-30-20-10 0 102030405060708090100110120 frc frequency (khz) temperature (celsius) 31 32 33 lprc frequency (khz) 30 31 32 33 -40-30-20-10 0 102030405060708090100110120 lprc frequency (khz) temperature (celsius) 0.550 0.600 0.650 0.700 0.750 0.800 0.850 forward voltage (v) 0.350 0.400 0.450 0.500 0.550 0.600 0.650 0.700 0.750 0.800 0.850 -40 -30 -20 -10 0 10 20 30 40 50 60 70 80 90 100 110 120 130 forward voltage (v) temperature (celsius) v f = 0.598 v f = 0.658 v f = 0.721 6 5 a , v f v r = - 1 . 5 6 m v / o c 6 . 5 a , v f v r = - 1 . 7 4 m v / o c 0 . 6 5 a , v f v r = - 1 . 9 2 m v / o c
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 462 preliminary ? 2011 microchip technology inc. notes:
? 2011 microchip technology inc. preliminary ds70657d-page 463 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 32.0 packaging information 32.1 package marking information 28-lead ssop (5.30 mm) example legend: xx...x customer-specific information y year code (last digit of calendar year) yy year code (last 2 digits of calendar year) ww week code (week of january 1 is week ?01?) nnn alphanumeric traceability code pb-free jedec designator for matte tin (sn) * this package is pb-free. the pb-free jedec designator ( ) can be found on the outer packaging for this package. note: in the event the full microchip part numbe r cannot be marked on one line, it will be carried over to the next line, t hus limiting the number of available characters for customer-specific information. 3 e 3 e 3 e 28-lead spdip (.300?) example dspic33ep64gp 502-i/sp 3 e 28-lead soic (7.50 mm) example yywwnnn xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx dspic33ep64gp 502-i/so 3 e 0610017 dspic33ep64 gp502-i/ss 0610017
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 464 preliminary ? 2011 microchip technology inc. 32.1 package marking information (continued) 28-lead qfn-s (6x6x0.9 mm) example xxxxxxxx xxxxxxxx yywwnnn pin 1 pin 1 legend: xx...x customer-specific information y year code (last digit of calendar year) yy year code (last 2 digits of calendar year) ww week code (week of january 1 is week ?01?) nnn alphanumeric traceability code pb-free jedec designator for matte tin (sn) * this package is pb-free. the pb-free jedec designator ( ) can be found on the outer packaging for this package. note: in the event the full microchip part numbe r cannot be marked on one line, it will be carried over to the next line, t hus limiting the number of available characters for customer-specific information. 3 e 3 e 33ep64gp 0610017 xxxxxxxxxx 36-lead vtla (tla) xxxxxxxxxx xxxxxxxxxx yywwnnn example xxxxxxxxxx 44-lead vtla (tla) xxxxxxxxxx xxxxxxxxxx yywwnnn dspic example 504-i/tl 0610017 33ep64gp 3 e dspic 504-i/tl 0610017 33ep64gp 3 e 502-i/mm 44-lead tqfp (10x10x1 mm) example xxxxxxxxxx yywwnnn xxxxxxxxxx xxxxxxxxxx dspic 504-i/pt 0610017 3 e 33ep64gp
? 2011 microchip technology inc. preliminary ds70657d-page 465 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 32.1 package marking information (continued) 64-lead tqfp (10x10x1 mm) example xxxxxxxxxx yywwnnn xxxxxxxxxx xxxxxxxxxx 64-lead qfn (9x9x0.9 mm) example pin 1 xxxxxxxxxxx xxxxxxxxxxx xxxxxxxxxxx yywwnnn pin 1 legend: xx...x customer-specific information y year code (last digit of calendar year) yy year code (last 2 digits of calendar year) ww week code (week of january 1 is week ?01?) nnn alphanumeric traceability code pb-free jedec designator for matte tin (sn) * this package is pb-free. the pb-free jedec designator ( ) can be found on the outer packaging for this package. note : in the event the full microchip part numbe r cannot be marked on one line, it will be carried over to the next line, t hus limiting the number of available characters for customer-specific information. 3 e 3 e dspic33ep 64gp506 0510017 506-i/pt 3 e 64gp506 -i/mr 0610017 3 e dspic33ep 44-lead qfn (8x8x0.9 mm) example xxxxxxxxxxx xxxxxxxxxxx yywwnnn xxxxxxxxxxx pin 1 pin 1 33ep64gp 504-i/ml 0610017 dspic
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 466 preliminary ? 2011 microchip technology inc. 32.2 package details 
       
      
 !"   !"#$%&" '  ()"&'"!&)
&#*& &  & #   +%&,  & !& - '!
!#.#

&"#'
#%! 

& "!
!
#%! 

& "!
!! 
&$#/  !#  '!
#&
   .0 1,2 1!'!
 
&$& "!
**&
"&&
 ! !" 3
& '
!&" & 4# *!( !!& 
  4 %&

&#& && 255***'
  
'5 4 6&! 7,8. '!
9'&! 7 7: ; 7"') 
%! 7 < &  1,
&
&  = =  
##4 4!!   -  1!&
&   = = 
"# &

"# >#& .  - -- 
##4>#& .  <  :  9&  - -?   &
& 9  -  9# 4!!  <   6  9#>#& )    9
* 9#>#& )  <  :  
* + 1 = = - note 1 n 12 d e1 eb c e l a2 e b b1 a1 a 3 
   

  * ,1
? 2011 microchip technology inc. preliminary ds70657d-page 467 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x note: for the most current package drawings, please see the microchip packaging specification located at http://www.microchip.com/packaging
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 468 preliminary ? 2011 microchip technology inc. note: for the most current package drawings, please see the microchip packaging specification located at http://www.microchip.com/packaging
? 2011 microchip technology inc. preliminary ds70657d-page 469 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x note: for the most current package drawings, please see the microchip packaging specification located at http://www.microchip.com/packaging
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 470 preliminary ? 2011 microchip technology inc.   
#$
 %  
  &'   
% !"   !"#$%&" '  ()"&'"!&)
&#*& &  & #   '!
!#.#

&"#'
#%! 

& "!
!
#%! 

& "!
!! 
&$#''  !# - '!
#&
   .0 1,2 1!'!
 
&$& "!
**&
"&&
 ! .32 % '!
("!"*&
"&&
 (%
%
'&
 "
!!
 !" 3
& '
!&" & 4# *!( !!& 
  4 %&

&#& && 255***'
  
'5 4 6&! 99. . '!
9'&! 7 7: ; 7"') 
%! 7 < &  ?1, :  8 &  = =  
##4 4!!  ?  < &#
%%   = = :  >#& .  < < 
##4>#& .  - ? :  9&     3
&9& 9    3
& & 9 .3 9# 4!!   =  3
& @ @ <@ 9#>#& )  = -< l l1 c a2 a1 a e e1 d n 1 2 note 1 b e 
   

  * ,-1
? 2011 microchip technology inc. preliminary ds70657d-page 471 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x note: for the most current package drawings, please see the microchip packaging specification located at http://www.microchip.com/packaging
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 472 preliminary ? 2011 microchip technology inc.    ( )* !   + ,,  -.-.'/   ()!
0 # '1  2   +# !"   !"#$%&" '  ()"&'"!&)
&#*& &  & #   4!!*!"&# - '!
#&
   .0 1,2 1!'!
 
&$& "!
**&
"&&
 ! .32 % '!
("!"*&
"&&
 (%
%
'&
 "
!!
 !" 3
& '
!&" & 4# *!( !!& 
  4 %&

&#& && 255***'
  
'5 4 6&! 99. . '!
9'&! 7 7: ; 7"') 
%! 7 < &  ?1, :  8 &  <   &#
%%     ,
&& 4!! - .3 :  >#& . ?1, .$
!##>#& . -? -  :  9&  ?1, .$
!##9&  -? -  ,
&&>#& ) - -< - ,
&&9& 9 -   ,
&&&
.$
!## a  = = d e 2 1 n e2 exposed pad 2 1 d2 n e b k l note 1 a3 a a1 top view bottom view 
   

  * ,1
? 2011 microchip technology inc. preliminary ds70657d-page 473 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x    ( )* !   + ,,  -.-.'/   ()!
0 # '1  2   +# !" 3
& '
!&" & 4# *!( !!& 
  4 %&

&#& && 255***'
  
'5 4
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 474 preliminary ? 2011 microchip technology inc. note: for the most current package drawings, please see the microchip packaging specification located at http://www.microchip.com/packaging
? 2011 microchip technology inc. preliminary ds70657d-page 475 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x note: for the most current package drawings, please see the microchip packaging specification located at http://www.microchip.com/packaging
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 476 preliminary ? 2011 microchip technology inc. note: for the most current package drawings, please see the microchip packaging specification located at http://www.microchip.com/packaging
? 2011 microchip technology inc. preliminary ds70657d-page 477 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x note: for the most current package drawings, please see the microchip packaging specification located at http://www.microchip.com/packaging
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 478 preliminary ? 2011 microchip technology inc. 11   3# ( )4 3  5.5.5  * '  3() !"   !"#$%&" '  ()"&'"!&)
&#*& &  & #   , '% !&
 ! 
&
b!c'   - '!
!#.#

&"#'
#%! 

& "!
!
#%! 

& "!
!! 
&$#''  !#  '!
#&
   .0 1,2 1!'!
 
&$& "!
**&
"&&
 ! .32 % '!
("!"*&
"&&
 (%
%
'&
 "
!!
 !" 3
& '
!&" & 4# *!( !!& 
  4 %&

&#& && 255***'
  
'5 4 6&! 99. . '!
9'&! 7 7: ; 7"') 
%9#! 7  9#&  <1, :  8 &  = =  
##4 4!!     &#
%%   =  3
&9& 9  ?  3
& & 9 .3 3
& @ -@ @ :  >#& . 1, :  9&  1, 
##4>#& . 1, 
##49&  1, 9# 4!!   =  9#>#& ) - -  
# %&
@ @ -@ 
# %&1
&&
' @ @ -@ a e e1 d d1 e b note 1 note 2 n 123 c a1 l a2 l1 
   

  * ,?1
? 2011 microchip technology inc. preliminary ds70657d-page 479 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x note: for the most current package drawings, please see the microchip packaging specification located at http://www.microchip.com/packaging
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 480 preliminary ? 2011 microchip technology inc. 11   ( )* !   + ,  .   ()! !"   !"#$%&" '  ()"&'"!&)
&#*& &  & #   4!!*!"&# - '!
#&
   .0 1,2 1!'!
 
&$& "!
**&
"&&
 ! .32 % '!
("!"*&
"&&
 (%
%
'&
 "
!!
 !" 3
& '
!&" & 4# *!( !!& 
  4 %&

&#& && 255***'
  
'5 4 6&! 99. . '!
9'&! 7 7: ; 7"') 
%! 7  &  ?1, :  8 &  <   &#
%%     ,
&& 4!! - .3 :  >#& . <1, .$
!##>#& . ?- ? ?< :  9&  <1, .$
!##9&  ?- ? ?< ,
&&>#& )  - -< ,
&&9& 9 -   ,
&&&
.$
!## a  = = d exposed pad d2 e b k l e2 2 1 n note 1 2 1 e n bottom view top view a3 a1 a 
   

  * ,-1
? 2011 microchip technology inc. preliminary ds70657d-page 481 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 11   ( )* !   + ,  .   ()! !" 3
& '
!&" & 4# *!( !!& 
  4 %&

&#& && 255***'
  
'5 4
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 482 preliminary ? 2011 microchip technology inc. note: for the most current package drawings, please see the microchip packaging specification located at http://www.microchip.com/packaging
? 2011 microchip technology inc. preliminary ds70657d-page 483 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x note: for the most current package drawings, please see the microchip packaging specification located at http://www.microchip.com/packaging
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 484 preliminary ? 2011 microchip technology inc. note: for the most current package drawings, please see the microchip packaging specification located at http://www.microchip.com/packaging
? 2011 microchip technology inc. preliminary ds70657d-page 485 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x 64-lead plastic thin quad flatpack (pt) ? 10x10x1 mm body, 2.00 mm footprint [tqfp] notes: 1. pin 1 visual index feature may vary, but must be located within the hatched area. 2. chamfers at corners are optional; size may vary. 3. dimensions d1 and e1 do not include mold flash or protrusions. mold flash or protrusions shall not exceed 0.25 mm per side. 4. dimensioning and tolerancing per asme y14.5m. bsc: basic dimension. theoretically exact value shown without tolerances. ref: reference dimension, usually without tolerance, for information purposes only. note: for the most current package drawings, please see the microchip packaging specification located at http://www.microchip.com/packaging units millimeters dimension limits min nom max number of leads n 64 lead pitch e 0.50 bsc overall height a C C 1.20 molded package thickness a2 0.95 1.00 1.05 standoff a1 0.05 C 0.15 foot length l 0.45 0.60 0.75 footprint l1 1.00 ref foot angle 0 3.5 7 overall width e 12.00 bsc overall length d 12.00 bsc molded package width e1 10.00 bsc molded package length d1 10.00 bsc lead thickness c 0.09 C 0.20 lead width b 0.17 0.22 0.27 mold draft angle top 11 12 13 mold draft angle bottom 11 12 13 d d1 e e1 e b n note 1 123 note 2 c l a1 l1 a2 a microchip technology drawing c04-085b
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 486 preliminary ? 2011 microchip technology inc. note: for the most current package drawings, please see the microchip packaging specification located at http://www.microchip.com/packaging
? 2011 microchip technology inc. preliminary ds70657d-page 487 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x appendix a: revision history revision a (april 2011) this is the initial released version of this document. revision b (july 2011) this revision includes minor typographical and formatting changes throughout the data sheet text. all other major changes are referenced by their respective section in ta b l e a - 1 . table a-1: major section updates section name update description ?high-performance, 16-bit digital signal controllers and microcontrollers? changed all pin diagrams references of vlap to tla. section 4.0 ?memory organization? updated the all resets values for clkdiv and pllfbd in the system control register map (see table 4-35). section 5.0 ?flash program memory? updated ?one word? to ?two words? in the first paragraph of section 5.2 ?rtsp operation? . section 9.0 ?oscillator configuration? updated the pll block diagram (see figure 9-2). updated the oscillator mode, fast rc oscillator (frc) with divide-by-n and pll (frcpll), by changing (frcdivn + pll) to (frcpll). changed (frcdivn + pll) to (frcpll) for cosc<2:0> = 001 and nosc<2:0> = 001 in the oscillator control register (see register 9-1). changed the por value from 0 to 1 for t he doze<1:0> bits, from 1 to 0 for the frcdiv<0> bit, and from 0 to 1 for t he pllpost<0> bit; updated the default definitions for the doze<2:0> and frcdiv <2:0> bits and updated all bit definitions for the pllpost<1:0> bits in the clock divisor register (see register 9-2). changed the por value from 0 to 1 for the plldiv<5:4> bits and updated the default definitions for all plldiv<8:0> bits in the pll feedback division register (see register 9-2). section 22.0 ?charge time measurement unit (ctmu)? updated the bit definitions for the irng<1:0> bits in the ctmu current control register (see register 22-3). section 25.0 ?op amp/ comparator module? updated the voltage reference block diagrams (see figure 25-1 and figure 25-2).
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 488 preliminary ? 2011 microchip technology inc. section 30.0 ?electrical characteristics? removed voltage on v cap with respect to vss and added note 5 in absolute maximum ratings (1) . removed parameter dc18 (v core ) and note 3 from the dc temperature and voltage specifications (see table 30-4). updated note 1 in the dc charac teristics: operating current (i dd ) (see table 30-6). updated note 1 in the dc characteristics: idle current (i idle ) (see table 30-7). changed the typical values for parameters dc60a-dc60d and updated note 1 in the dc characteristics: power-down current (i pd ) (see table 30-8). updated note 1 in the dc characteristics: doze current (i doze ) (see table 30-9). updated note 2 in the electrical characteristics: bor (see table 30-12). updated parameters cm20 and cm31, and added parameters cm44 and cm45 in the ac/dc characteristics: op amp/comparator (see table 30-14). added the op amp/comparator reference voltage settling time specifications (see table 30-15). added op amp/comparator voltage refer ence dc specifications (see table 30-16). updated internal frc accuracy parameter f20a (see table 30-21). updated the typical value and units for parameter ctmui1, and added parameters ctmui4, ctmufv1, and ctmufv2 to the ctmu current source specifications (see table 30-55). section 31.0 ?packaging information? updated packages by replacing references of vlap with tla. ?product identification system? changed vlap to tla. table a-1: major section updates (continued) section name update description
? 2011 microchip technology inc. preliminary ds70657d-page 489 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x revision c (december 2011) this revision includes typographical and formatting changes throughout the data sheet text. in addition, where applicable, new sections were added to each peripheral chapter th at provide information and links to related resources, as well as helpful tips. for examples, see section 20.1 ?uart helpful tips? and section 3.6 ?cpu resources? . all occurrences of tla were updated to vtla throughout the document, with the exception of the pin diagrams (updated diagrams were not available at time of publication). a new chapter, section 31.0 ?dc and ac device characteristics graphs? , was added. all other major changes are referenced by their respective section in table a-2 . table a-2: major section updates section name update description ?16-bit microcontrollers and digital signal controllers (up to 256 kb flash and 32 kb sram) with high-sp eed pwm, op amps, and advanced analog? the content on the first page of this sect ion was extensively reworked to provide the reader with the key features and functionality of this device family in an ?at-a-glance? format. section 1.0 ?device overview? updated the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x block diagr am (see figure 1-1), which now contains a cpu block and a reference to the cpu diagram. updated the description and note references in the pinout i/o descriptions for these pins: c1in2-, c2in2-, c3in2-, oa1out, oa2out, and oa3out (see table 1-1). section 2.0 ?guidelines for getting started with 16-bit digital signal controllers and microcontrollers? updated the recommended minimum connection diagram (see figure 2-1). section 3.0 ?cpu? updated the DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x cpu block diagram (see figure 3-1). updated the status register definition in the programmer?s model (see figure 3-2). section 4.0 ?memory organization? updated the data memory maps (see figure 4-6 and figure 4-11). removed the dcb<1:0> bits from the oc1con2, oc2con2, oc3con2, and oc4con2 registers in the output compare 1 through output compare 4 register map (see table 4-10). added the trig1 and trgcon1 registers to the pwm1 generator 1 register map (see table 4-13). added the trig2 and trgcon2 registers to the pwm1 generator 1 register map (see table 4-14). added the trig3 and trgcon3 registers to the pwm1 generator 1 register map (see table 4-15). updated the second note in section 4.7.1 ?bit-reversed addressing implementation? . section 8.0 ?direct memory access (dma)? updated the dma controller diagram (see figure 8-1). section 14.0 ?input capture? updated the bit values for the icx clock source of the ictsel<12:10> bits in the icxcon1 register (see register 14-1). section 15.0 ?output compare? updated the bit values for the ocx clock source of the octsel<2:0> bits in the ocxcon1 register (see register 15-1). removed the dcb<1:0> bits from the output compare x control register 2 (see register 15-2).
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 490 preliminary ? 2011 microchip technology inc. section 16.0 ?high-speed pwm module (dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only)? updated the high-speed pwm module register interconnection diagram (see figure 16-2). added the trgconx and trigx registers (see register 16-12 and register 16-14, respectively). section 21.0 ?enhanced can (ecan?) module (dspic33epxxxgp/mc50x devices only)? updated the cancks bit value definitions in cictrl1: ecan control register 1 (see register 21-1). section 22.0 ?charge time measurement unit (ctmu)? updated the irng<1:0> bit value definitions and added note 2 in the ctmu current control register (see register 22-3). section 25.0 ?op amp/ comparator module? updated the op amp/comparator i/o op erating modes diagram (see figure 25-1). updated the user-programmable blanking function block diagram (see figure 25-3). updated the digital filter interconnect block diagram (see figure 25-4). added section 25.1 ?op amp application considerations? . added note 2 to the comparator control register (see register 25-2). updated the bit definitions in the comparator mask gating control register (see register 25-5). section 27.0 ?special features? updated the ficd configuration register, updated note 1, and added note 3 in the configuration byte regist er map (see table 27-1). added section 27.2 ?user id words? . section 30.0 ?electrical characteristics? updated the following absolute maximum ratings: ? maximum current out of v ss pin ? maximum current into v dd pin added note 1 to the operating mi ps vs. voltage (see table 30-1). updated all idle current (i idle ) typical and maximum dc characteristics values (see table 30-7). updated all doze current (i doze ) typical and maximum dc characteristics values (see table 30-9). added note 2, removed parameter cm24, updated the typical values parameters cm10, cm20, cm21, cm32, cm41, cm44, and cm45, and updated the minimum values for cm40 and cm41, and the maximum value for cm40 in the ac/dc characteristics: op amp/comparator (see table 30-14). updated note 2 and the typical value for parameter vr310 in the op amp/ comparator reference voltage settling time specifications (see table 30-15). added note 1, removed parameter vrd312, and added parameter vrd314 to the op amp/comparator voltage reference dc specifications (see table 30-16). updated the minimum, typical, and maximum values for internal lprc accuracy (see table 30-22). updated the minimum, typical, and maximum values for parameter sy37 in the reset, watchdog timer, oscillator star t-up timer, power-up timer timing requirements (see table 30-24). the maximum data rate values were updated for the spi2 maximum data/clock rate summary (see table 30-35) table a-2: major section updates (continued) section name update description
? 2011 microchip technology inc. preliminary ds70657d-page 491 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x section 30.0 ?electrical characteristics? (continued) these spi2 timing requirements were updated: ? maximum value for parameter sp10 and the minimum clock period value for sckx in note 3 (see table 30-36, table 30-37, and table 30-38) ? maximum value for parameter sp70 and the minimum clock period value for sckx in note 3 (see table 30-40 and table 30-42) ? the maximum data rate values were updated for the spi2 maximum data/clock rate summary (see table 30-43) these spi1 timing requirements were updated: ? maximum value for parameters sp10 and the minimum clock period value for sckx in note 3 (see table 30-44, table 30-45, and table 30-46) ? maximum value for parameters sp70 and the minimum clock period value for sckx in note 3 (see table 30-47 through table 30-50) ? minimum value for parameters sp40 and sp41 see table 30-44 through table 30-50) updated all typical values for the ctmu current source specifications (see table 30-55). updated note1, the maximum value for parameter ad06, the minimum value for ad07, and the typical values for ad09 in the adc module specifications (see table 30-56). added note 1 to the adc module specifications (12-bit mode) (see table 30-57). added note 1 to the adc module specifications (10-bit mode) (see table 30-58). updated the minimum and maximum values for parameter ad21b in the 10-bit mode adc module specifications (see table 30-58). updated note 2 in the adc conversion (12-bit mode) timing requirements (see table 30-59). updated note 1 in the adc conversion (10-bit mode) timing requirements (see table 30-60). table a-2: major section updates (continued) section name update description
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 492 preliminary ? 2011 microchip technology inc. revision d (december 2011) this revision includes typographical and formatting changes throughout the data sheet text. all other major changes are referenced by their respective section in ta b l e a - 3 . table a-3: major section updates section name update description ?16-bit microcontrollers and digital signal controllers (up to 256 kb flash and 32 kb sram) with high-sp eed pwm, op amps, and advanced analog? removed the analog comparators column and updated the op amps/comparators column in ta b l e 1 and ta b l e 2 . section 21.0 ?enhanced can (ecan?) module (dspic33epxxxgp/mc50x devices only)? updated the cancks bit value definitions in cictrl1: ecan control register 1 (see register 21-1 ). section 30.0 ?electrical characteristics? updated the v bor specifications and/or its related note in the following electrical characteristics tables: ? table 30-1 ? table 30-4 ? table 30-12 ? table 30-14 ? table 30-15 ? table 30-16 ? table 30-56 ? table 30-57 ? table 30-58 ? table 30-59 ? table 30-60
? 2011 microchip technology inc. preliminary ds70657d-page 493 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x index a ac characteristics ............................................................ 409 capacitive loading requirements on output pins ... 409 internal frc accuracy.............................................. 411 internal rc accuracy ................................................ 411 load conditions ........................................................ 409 adc initialization ............................................................... 311 key features............................................................. 311 analog-to-digital converter (adc).................................... 311 arithmetic logic unit (alu)................................................. 40 assembler mpasm assembler................................................... 390 b bit-reversed addressing example .................................................................... 108 implementation ......................................................... 107 sequence table (16-entry)....................................... 108 bit-reversed addressing (dspic33epxxxmc20x/50x and DSPIC33EPXXXGP50X devices only) .............. 107 block diagrams 16-bit timer1 module ................................................ 195 adc conversion clock period.................................. 313 adc1 and adc2 module .......................................... 312 comparator i/o operating modes............................. 345 comparator voltage reference ................................ 346 connections for on-chip voltage regulator............. 375 cpu core.................................................................... 32 crc module ............................................................. 363 crc shift engine...................................................... 363 ctmu configurations time measurement ........................................... 305 digital filter interconnect .......................................... 347 DSPIC33EPXXXGP50X, dspic33epxxxmc20x/50x, and pic24epxxxgp/mc20x............................. 21 ecan module ........................................................... 280 input capture ............................................................ 205 oscillator system diagram ....................................... 145 output compare ....................................................... 211 pll............................................................................ 146 quadrature encoder interface .................................. 242 reset system............................................................ 115 shared port structure ............................................... 165 spix module.............................................................. 258 type b (timer2 and timer4)..................................... 200 type c (timer3 and timer5)..................................... 200 uart ........................................................................ 273 user programmable blanking function .................... 346 watchdog timer (wdt) ............................................ 376 c c compilers mplab c18 .............................................................. 390 charge time measurement unit. see ctmu. code examples port write/read ........................................................ 166 pwrsav instruction syntax..................................... 155 code protection ........................................................ 369, 377 configuring analog port pins ............................................ 166 cpu control register .......................................................... 36 cpu clocking system....................................................... 146 sources .................................................................... 146 crc user interface ........................................................... 364 data .................................................................. 364 ctmu module register map .............................................................. 90 customer change notification service............................. 499 customer notification service .......................................... 499 customer support............................................................. 499 d data address space........................................................... 46 alignment.................................................................... 46 memory map for dspic33ep128mc20x/50x and dspic33ep128gp50x devices................... 49 memory map for dspic33ep256mc20x/50x and dspic33ep256gp50x devices................... 50 memory map for dspic33ep32mc20x/50x and dspic33ep32gp50x devices..................... 47 memory map for dspic33ep64mc20x/50x and dspic33ep64gp50x devices..................... 48 memory map for pic24ep128gp/mc20x/50x devices ............... 53 memory map for pic24ep256gp/mc20x/50x devices ............... 54 memory map for pic24ep32gp/mc20x/50x devices ................. 51 memory map for pic24ep64gp/mc20x/50x devices ................. 52 near data space ........................................................ 46 sfr ............................................................................ 46 width .......................................................................... 46 dc and ac characteristics graphs and tables ................................................... 459 dc characteristics............................................................ 394 bor.......................................................................... 404 i/o pin input specifications ...................................... 401 i/o pin output specifications............................ 404, 406 idle current (i doze ) .................................................. 400 idle current (i idle ) .................................................... 397 internal voltage regulator........................................ 395 operating current (i dd ) ............................................ 396 power-down current (i pd )........................................ 398 program memory...................................................... 405 temperature and voltage specifications.................. 395 development support ....................................................... 389 dma module dsadr register ........................................................ 139 supported peripherals............................................... 131 dmac registers ............................................................... 133 dmaxcnt ................................................................ 133 dmaxcon................................................................ 133 dmaxpad ................................................................ 133 dmaxreq ................................................................ 133 dmaxsta................................................................. 133 dmaxstb................................................................. 133 doze mode ....................................................................... 157 dsp engine ........................................................................ 40 e ecan module cibufpnt1 register................................................. 291 cibufpnt2 register................................................. 292 cibufpnt3 register................................................. 292
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 494 preliminary ? 2011 microchip technology inc. cibufpnt4 register ................................................. 293 cicfg1 register ........................................................ 289 cicfg2 register ........................................................ 290 cictrl1 register ...................................................... 282 cictrl2 register ...................................................... 283 ciec register............................................................. 289 cifctrl register ...................................................... 285 cifen1 register ........................................................ 291 cififo register ......................................................... 286 cifmsksel1 register ............................................... 295 cifmsksel2 register ............................................... 296 ciinte register ......................................................... 288 ciintf register.......................................................... 287 cirxfneid register .................................................. 295 cirxfnsid register .................................................. 294 cirxful1 register .................................................... 298 cirxful2 register .................................................... 298 cirxmneid register.................................................. 297 cirxmnsid register.................................................. 297 cirxovf1 register ................................................... 299 cirxovf2 register ................................................... 299 citrmncon register ................................................ 300 civec register .......................................................... 284 modes of operation .................................................. 281 overview ................................................................... 279 ecan registers acceptance filter enable register (cifen1)............ 291 acceptance filter extended identifier register n (cirxfneid) ..................................................... 295 acceptance filter mask extended identifier register n (cirxmneid) .................................................... 297 acceptance filter mask standard identifier register n (cirxmnsid) .................................................... 297 acceptance filter standard identifier register n (cirxfnsid) ..................................................... 294 baud rate configuration register 1 (cicfg1) ......... 289 baud rate configuration register 2 (cicfg2) ......... 290 control register 1 (cictrl1) ................................... 282 control register 2 (cictrl2) ................................... 283 fifo control register (cifctrl) ............................ 285 fifo status register (cififo) ................................. 286 filter 0-3 buffer pointer register (cibufpnt1) ....... 291 filter 12-15 buffer pointer register (cibufpnt4) ... 293 filter 15-8 mask selection register (cifmsksel2). 296 filter 4-7 buffer pointer register (cibufpnt2) ....... 292 filter 7-0 mask selection register (cifmsksel1)... 295 filter 8-11 buffer pointer register (cibufpnt3) ..... 292 interrupt code register (civec) .............................. 284 interrupt enable register (ciinte) ........................... 288 interrupt flag register (ciintf) ............................... 287 receive buffer full register 1 (cirxful1).............. 298 receive buffer full register 2 (cirxful2).............. 298 receive buffer overflow r egister 2 (cirxovf2)..... 299 receive overflow register (cirxovf1) .................. 299 ecan transmit/receive error count register (ciec) ..... 289 ecan tx/rx buffer m control register (citrmncon) .. 300 electrical characteristics................................................... 393 ac ............................................................................. 409 enhanced can module..................................................... 279 equations device operating frequency .................................... 146 errata .................................................................................. 19 f flash program memory..................................................... 111 control registers ...................................................... 112 operations ................................................................ 112 programming algorithm ............................................ 114 rtsp operation ....................................................... 112 table instructions ..................................................... 111 flexible configuration ....................................................... 369 h high-speed pwm ............................................................. 217 i i/o ports............................................................................ 165 parallel i/o (pio) ...................................................... 165 write/read timing .................................................... 166 in-circuit debugger........................................................... 377 in-circuit emulation .......................................................... 369 in-circuit serial programming (icsp)....................... 369, 377 input capture .................................................................... 205 registers .................................................................. 207 input change notification ................................................. 166 instruction addressing modes .......................................... 104 file register instructions .......................................... 104 fundamental modes supported ............................... 105 mac instructions (dspic33epxxxmc20x/50x and DSPIC33EPXXXGP50X devices only)............. 105 mcu instructions ...................................................... 104 move and accumulator instructions.......................... 105 other instructions ..................................................... 105 instruction set overview................................................................... 382 summary .................................................................. 379 instruction-based power-saving modes........................... 155 idle ............................................................................ 156 sleep ........................................................................ 156 internal rc oscillator use with wdt........................................................... 376 internet address ............................................................... 499 interrupt control and status registers ............................. 123 ifsx .......................................................................... 123 intcon1 .................................................................. 123 intcon2 .................................................................. 123 interrupt vector table (ivt) .............................................. 119 interrupts coincident with power save instructions ......... 156 j jtag boundary scan interface ........................................ 369 jtag interface.................................................................. 377 m memory organization ......................................................... 41 microchip internet web site.............................................. 499 modulo addressing applicability............................................................... 107 operation example ................................................... 106 start and end address ............................................. 106 w address register selection .................................. 106 modulo addressing (dspic33epxxxmc20x/50x and DSPIC33EPXXXGP50X devices only) ..................... 106 most recent ram address low register ........................ 139 most recent ram high address ...................................... 139 mplab asm30 assembler, linker, librarian ................... 390 mplab integrated development environment software.. 389 mplab pm3 device programmer .................................... 392 mplab real ice in-circuit emulator system ................ 391 mplink object linker/mplib object librarian ................ 390
? 2011 microchip technology inc. preliminary ds70657d-page 495 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x o open-drain configuration ................................................. 166 output compare ............................................................... 211 p packaging ......................................................................... 463 details ....................................................................... 485 marking ............................................................. 463, 465 peripheral module disable (pmd) .................................... 157 peripheral trigger generat or (ptg) module .................... 327 peripherals supported by dma ......................................... 131 pinout i/o descriptions (table) ............................................ 22 power-saving features .................................................... 155 clock frequency and switching................................ 155 program address space ..................................................... 41 construction.............................................................. 109 data access from program memory using table instructions ............................................. 110 data access from, ad dress generation.................... 109 memory map ............................................. 41, 42, 43, 44 table read instructions tblrdh ........................................................... 110 tblrdl ............................................................ 110 program memory organization................................................................ 45 reset vector ............................................................... 45 programmable crc special function registers ......................................... 82 programmer?s model........................................................... 32 register description.................................................... 33 ptg introduction ............................................................... 327 q quadrature encoder interface (qei) ................................. 241 r reader response ............................................................. 500 register ptg adjust (ptgadj) .............................................. 338 ptg literal (ptgl0) ................................................. 338 ptg step queue pointer (ptgqptr) ..................... 339 ptg step queue pointer register 0 (ptgque0) .... 339 register maps adc1 and adc2......................................................... 78 comparator ................................................................. 90 cpu core (dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only) ................. 56 cpu core (pic24epxxxgp/mc20x devices only).. 58 cpu core for DSPIC33EPXXXGP50X and pic24epxxxgp20x devices only ................... 58 dmac ......................................................................... 91 ecan1 (when win (c1ctrl) = 0 or 1) dspic33epxxxmc/gp50x devices only.......... 79 ecan1 (when win (c1ctrl) = 0) dspic33epxxxmc/gp50x devices only.......... 79 ecan1 (win (c1ctrl) = 1) dspic33epxxxmc/gp50x devices only.......... 80 i2c1 and i2c2............................................................. 76 input capture 1 through input capture 16 .................. 70 interrupt controller (DSPIC33EPXXXGP50X devices only) .............. 63 interrupt controller (dspic33epxxxmc20x devices only) ............. 65 interrupt controller (dspic33epxxxmc50x devices only) ............. 67 interrupt controller (pic24epxxxgp20x devices only) ................. 59 interrupt controller (pic24epxxxmc20x devices only) ................. 61 output compare 1 through output compare 16 ........ 71 peripheral pin select input (DSPIC33EPXXXGP50X devices only).............. 85 peripheral pin select input (dspic33epxxxmc20x devices only) ............. 86 peripheral pin select input (dspic33epxxxmc50x devices only) ............. 85 peripheral pin select input (pic24epxxxgp20x devices only) ................. 84 peripheral pin select input (pic24epxxxmc20x devices only) ................. 84 peripheral pin select output (dspic33epxxxgp/mc202/502 and pic24epxxxgp/mc202 devices only) ............ 82 peripheral pin select output (dspic33epxxxgp/mc203/503 and pic24epxxxgp/mc203 devices only) ............ 82 peripheral pin select output (dspic33epxxxgp/mc204/504 and pic24epxxxgp/mc204 devices only) ............ 83 peripheral pin select output (dspic33epxxxgp/mc206/506 and pic24epxxgp/mc206 devices only)............... 83 pmd (dspic33epxxxmc50x devices only) ............ 89 pmd (pic24epxxxgp20x devices only) ................ 88 porta (pic24epxxxgp/mc202 and dspic33epxxxgp/mc202/502 devices only).. 97 porta (pic24epxxxgp/mc203 and dspic33epxxxgp/mc203/503 devices only).. 96 porta (pic24epxxxgp/mc204 and dspic33epxxxgp/mc204/504 devices only).. 95 porta (pic24epxxxgp/mc206 and dspic33epxxxgp/mc206/506 devices only).. 92 portb (pic24epxxxgp/mc202 and dspic33epxxxgp/mc202/502 ......................... 97 portb (pic24epxxxgp/mc203 and dspic33epxxxgp/mc203/503 devices only).. 96 portb (pic24epxxxgp/mc204 and dspic33epxxxgp/mc204/504 devices only... 95 portb (pic24epxxxgp/mc206 and dspic33epxxxgp/mc206/506 devices only) 92 portc (pic23epxxxgp/mc203 and dspic33epxxxgp/mc203/503 devices only).. 96 portc (pic24epxxxgp/mc204 and dspic33epxxxgp/mc204/504 devices only).. 95 portc (pic24epxxxgp/mc206 and dspic33epxxxgp/mc206/506 devices only).. 92 portd
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 496 preliminary ? 2011 microchip technology inc. (pic24epxxxgp/mc206 and dspic33epxxxgp/mc206/506 devices only) .. 93 porte (pic24epxxxgp/mc206 and dspic33epxxxgp/mc206/506 devices only) .. 93 portf (pic24epxxxgp/mc206 and dspic33epxxxgp/mc206/506 devices only) .. 93 portg (pic24epxxxgp/mc206 and dspic33epxxxgp/mc206/506 devices only) .. 94 pwm (dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only)................... 73 pwm generator 1 (dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only)................... 73 pwm generator 2 (dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only)................... 74 pwm generator 3 (dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only)................... 74 qei1 register map (dspic33epxxxmc20x/50x and pic24epxxxmc20x devices only)................... 75 reference clock ......................................................... 87 spi1, spi2, spi3, and spi4 ........................................ 77 system control ........................................................... 87 timer1 through timer9 ............................................... 69 uart1, uart2, uart3, and uart4 ........................ 76 registers ad1chs0 (adc1 input channel 0 select) ............... 322 ad1chs123 (adc1 input channel 1, 2, 3 select) ... 321 ad1con1 (adc1 control 1) .................................... 315 ad1con2 (adc1 control 2) .................................... 317 ad1con3 (adc1 control 3) .................................... 319 ad1con4 (adc1 control 4) .................................... 320 ad1cssh (adc1 input scan select high) .............. 324 ad1cssl (adc1 input scan select low) ................ 325 altdtrx (pwm alternate dead-time) .................... 230 auxconx (pwm auxiliary control).......................... 239 chop (pwm chop clock generator)....................... 226 cibufpnt1 (ecan filter 0-3 buffer pointer)........... 291 cibufpnt2 (ecan filter 4-7 buffer pointer)........... 292 cibufpnt3 (ecan filter 8-11 buffer pointer)......... 292 cibufpnt4 (ecan filter 12-15 buffer pointer)....... 293 cicfg1 (ecan baud rate configuration 1) ............ 289 cicfg2 (ecan baud rate configuration 2) ............ 290 cictrl1 (ecan control 1) ...................................... 282 cictrl2 (ecan control 2) ...................................... 283 ciec (ecan transmit/receive error count)............ 289 cifctrl (ecan fifo control) ................................ 285 cifen1 (ecan acceptance filter enable) ............... 291 cififo (ecan fifo status)..................................... 286 cifmsksel1 (ecan filter 7-0 mask selection) ...... 295 cifmsksel2 (ecan filter 15-8 mask selection) .... 296 ciinte (ecan interrupt enable) .............................. 288 ciintf (ecan interrupt flag) ................................... 287 cirxfneid (ecan acceptance filter n extended identifier)........................................... 295 cirxfnsid (ecan acceptance filter n standard identifier) ........................................... 294 cirxful1 (ecan receive buffer full 1) ................. 298 cirxful2 (ecan receive buffer full 2) ................. 298 cirxmneid (ecan acceptance filter mask n extended identifier) .......................................... 297 cirxmnsid (ecan acceptance filter mask n standard identifier) ........................................... 297 cirxovf1 (ecan receive buffer overflow 1)........ 299 cirxovf2 (ecan receive buffer overflow 2)........ 299 citrbnsid (ecan buffer n standard identifier)..... 301, 302, 304 citrmncon (ecan tx/rx buffer m control) ........ 300 civec (ecan interrupt code).................................. 284 clkdiv (clock divisor) ............................................ 150 cm4con (comparator control 4) ............................ 355 cmstat (comparator status) ................................. 351 cmxcon (comparator control 1-3) ......................... 353 cmxfltr (comparator filter control) ..................... 361 cmxmskcon (comparator mask gating control) .. 359 cmxmsksrc (comparator mask source control) .. 357 corcon (core control) .................................... 38, 125 ctmucon (ctmu control) ............................. 307, 308 ctmucon1 (ctmu control register 1).................. 307 ctmucon1 (ctmu control register 2).................. 308 ctmuicon (ctmu current control) ....................... 309 cvrcon (comparator voltage reference control) 362 devid (device id).................................................... 373 devrev (device revision)...................................... 373 dtrx (pwm dead-time).......................................... 230 fclconx (pwm fault current-limit control).......... 235 i2cxcon (i2cx control) ........................................... 268 i2cxmsk (i2cx slave mode address mask) ............ 272 i2cxstat (i2cx status) ........................................... 270 icxcon1 (input capture x control 1)....................... 207 icxcon2 (input capture x control 2)....................... 208 idnxxcnth (index counter high word) ................. 251 indxxcntl (index counter low word)................... 251 indxxhld (index counter hold).............................. 252 intcon1 (interrupt control 1).................................. 126 intcon2 (interrupt control 2).................................. 128 intcon2 (interrupt control 3).................................. 129 intcon4 (interrupt control 4).................................. 129 inttreg interrupt control and status register ...... 130 intxhldh (interval timer hold high word)............. 255 intxhldl (interval timer hold low word) .............. 255 intxtmrh (interval timer high word) .................... 254 intxtmrl (interval timer low word) ..................... 255 ioconx (pwm i/o control)...................................... 232 lebconx (leading-edge blanking control) ............ 237 lebdlyx (leading-edge blanking delay) ............... 238 mdc (pwm master duty cycle) ............................... 226 nvmcom (flash memory control)........................... 114 nvmcon (non-volatile (nvm) memory control) ..... 113 nvmkey (non-volatile memory key) ....................... 114 ocxcon1 (output compare x control 1) ................ 213 ocxcon2 (output compare x control 2) ................ 215 osccon (oscillator control) ................................... 148 osctun (frc oscillator tuning)............................ 153 pdcx (pwm generator duty cycle)......................... 229 phasex (pwm primary phase shift)....................... 229 pllfbd (pll feedback divisor).............................. 152 pmd1 (peripheral module disable control 1)........... 158 pmd2 (peripheral module disable control 2)........... 160 pmd3 (peripheral module disable control 3)........... 161 pmd4 (peripheral module disable control 4)........... 161 pmd6 (peripheral module disable control 6)........... 162 pmd7 (peripheral module disable control 7)........... 163 posxcnth (position counter high word) .............. 250
? 2011 microchip technology inc. preliminary ds70657d-page 497 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x posxcntl (position counter low word) ................ 250 posxhld (position counter hold) ........................... 250 ptcon (pwm time base control) .......................... 222 ptcon2 (primary master clock divider select) ...... 224 ptg broadcast trigger enable (ptgbte) ............... 333 ptg control (ptgcon) ........................................... 332 ptg control/status (ptgcst)................................. 330 ptg counter 0 limit (ptgc0lim)............................ 336 ptg counter 1 limit (ptgc1lim)............................ 337 ptg hold (ptghold) ............................................. 337 ptg step delay limit (ptgsdlim).......................... 336 ptg timer0 limit (ptgt0lim)................................. 335 ptg timer1 limit (ptgt1lim)................................. 335 ptper (primary master time base period)............. 225 pwmconx (pwm control)....................................... 227 qei1con (qei control)............................................ 244 qei1gech (greater than or equal compare high word)........................................................ 254 qei1gecl (greater than or equal compare low word) ........................................................ 254 qei1ich (initialization/capture high word).............. 252 qei1icl (initialization/capture low word) ............... 252 qei1ioc (qei i/o control) ....................................... 246 qei1lech (less than or equal compare high word)........................................................ 253 qei1lecl (less than or equal compare low word) ........................................................ 253 qei1stat (qei status)............................................ 248 rcon (reset control) .............................................. 117 refocon (reference osci llator control) ............... 154 rpinr0 (peripheral pin select input 0).................... 173 rpinr1 (peripheral pin select input 1).................... 174 rpinr11 (peripheral pin select input 11)................ 178 rpinr12 (peripheral pin select input 12)................ 179 rpinr14 (peripheral pin select input 14)................ 180 rpinr15 (peripheral pin select input 15)................ 181 rpinr18 (peripheral pin select input 18)................ 182 rpinr19 (peripheral pin select input 19)................ 183 rpinr20 (peripheral pin select input 20)................ 184 rpinr23 (peripheral pin select input 23)................ 185 rpinr26 (peripheral pin select input 26)................ 186 rpinr3 (peripheral pin select input 3).................... 175 rpinr37 (peripheral pin select input 37)................ 187 rpinr38 (peripheral pin select input 38)................ 188 rpinr40 (peripheral pin select input 40)................ 189 rpinr7 (peripheral pin select input 7).................... 176 rpinr8 (peripheral pin select input 8).................... 177 rpor0 (peripheral pin select output 0).................. 190 rpor1 (peripheral pin select output 1).................. 190 rpor2 (peripheral pin select output 2).................. 191 rpor3 (peripheral pin select output 3).................. 191 rpor4 (peripheral pin select output 4).................. 192 rpor5 (peripheral pin select output 5).................. 192 rpor6 (peripheral pin select output 6).................. 193 rpor7 (peripheral pin select output 7).................. 193 rpor8 (peripheral pin select output 8).................. 194 rpor9 (peripheral pin select output 9).................. 194 sevtcmp (primary special event compare) .......... 225 spixcon1 (spix control 1)...................................... 262 spixcon2 (spix control 2)...................................... 263 spixstat (spix status and control) ....................... 260 sr (cpu status)................................................. 36, 124 t1con (timer1 control)........................................... 197 trgconx (pwm trigger control) ........................... 231 trigx (pwm primary trigger compare value)........ 234 txcon (t2con or t4con control) ........................ 202 tycon (t3con or t5con control) ........................ 203 uxmode (uartx mode) ......................................... 275 uxsta (uartx status and control) ........................ 277 velxcnt (velocity counter).................................... 251 reset illegal opcode........................................................... 115 uninitialized w register ........................................... 115 reset sequence ............................................................... 119 resets .............................................................................. 115 resources required for digital pfc............................. 28, 30 s serial peripheral interface (spi) ....................................... 257 software simulator (mplab sim) .................................... 391 software stack pointer, frame pointer calll stack frame ................................................. 104 special features of the cpu ............................................ 369 symbols used in opcode descriptions ............................ 380 t temperature and voltage specifications ac............................................................................. 409 timer1 .............................................................................. 195 timer2/3 and timer4/5 ..................................................... 199 timing characteristics clko and i/o ........................................................... 412 timing diagrams 10-bit adc conversion (chps<1:0> = 01, simsam = 0, asam = 0, ssrc<3:0> = 000) ........................................... 457 10-bit adc conversion (chps<1:0> = 01, simsam = 0, asam = 1, ssrc<2:0> = 111, samc<4:0> = 00001)....................................... 457 10-bit adc conversion (chps<1:0> = 01, simsam = 0, asam = 1, ssrc<3:0> = 111, samc<4:0> = 00010)....................................... 457 12-bit adc conversion (asam = 0, ssrc<3:0> = 000)........................ 455 ecan i/o.................................................................. 450 external clock .......................................................... 410 i2cx bus data (master mode) .................................. 446 i2cx bus data (slave mode) .................................... 448 i2cx bus start/stop bits (master mode)................... 446 i2cx bus start/stop bits (slave mode)..................... 448 input capture (capx) ............................................... 416 motor control pwm .................................................. 418 motor control pwm fault ......................................... 418 oc/pwm .................................................................. 417 output compare (ocx) ............................................ 416 qea/qeb input ........................................................ 420 qei module index pulse........................................... 421 timer1, 2, 3 external clock .............................. 412, 414 timerq (qei module) external clock ....................... 419 timing requirements clko and i/o ........................................................... 412 dci ac-link mode.................................................... 457 dci multi-channel, i 2 s modes ................................. 457 dma module............................................................. 458 external clock .......................................................... 410 timing specifications 10-bit adc conversion requirements ..................... 458 12-bit adc conversion requirements ..................... 456 can i/o requirements............................................. 450 i2cx bus data requirements (master mode)........... 447
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 498 preliminary ? 2011 microchip technology inc. i2cx bus data requirements (slave mode) ............. 449 motor control pwm requirements ........................... 418 output compare requirements ................................ 416 pll clock.................................................................. 411 qei external clock requirements ............................ 419 qei index pulse requirements................................. 421 quadrature decoder requirements .......................... 420 reset, watchdog timer, oscillator start-up timer, power-up timer and brown-out reset requirements.................................................... 413 simple oc/pwm mode requirements ..................... 417 timer1 external clock requirements ....................... 414 timer2 external clock requirements ....................... 415 timer3 external clock requirements ....................... 415 u universal asynchronous rece iver transmitter (uart).... 273 v voltage regulator (on-chip)............................................. 375 w watchdog timer (wdt) ............................................ 369, 376 programming considerations ................................... 376 www address.................................................................. 499 www, on-line support...................................................... 19
? 2011 microchip technology inc. preliminary ds70657d-page 499 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x the microchip web site microchip provides online support via our www site at www.microchip.com . this web site is used as a means to make files and information easily available to customers. accessible by using your favorite internet browser, the web site contains the following information: ? product support ? data sheets and errata, application notes and sample programs, design resources, user?s guides and hardware support documents, latest software releases and archived software ? general technical support ? frequently asked questions (faqs), technical support requests, online discussion groups, microchip consultant program member listing ? business of microchip ? product selector and ordering guides, latest microchip press releases, listing of seminars and events, listings of microchip sales offices, distributors and factory representatives customer change notification service microchip?s customer notification service helps keep customers current on microchip products. subscribers will receive e-mail notification whenever there are changes, updates, revisions or errata related to a specified product family or de velopment tool of interest. to register, access the microchip web site at www.microchip.com . under ?support?, click on ?customer change notification? and follow the registration instructions. customer support users of microchip products can receive assistance through several channels: ? distributor or representative ? local sales office ? field application engineer (fae) ? technical support customers should contact their distributor, representative or field application engineer (fae) for support. local sales offices are also available to help customers. a listing of sa les offices and locations is included in the back of this document. technical support is available through the web site at: http://microchip.com/support
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 500 preliminary ? 2011 microchip technology inc. reader response it is our intention to provide you with the best document ation possible to ensure succe ssful use of your microchip product. if you wish to provide your comments on organiz ation, clarity, subject matter, and ways in which our documentation can better serve you, please fax your comments to the technical publications manager at (480) 792-4150. please list the following information, and use this outli ne to provide us with your comments about this document. to: technical publications manager re: reader response total pages sent ________ from: name company address city / state / zip / country telephone: (_______) _________ - _________ application (optional): would you like a reply? y n device: literature number: questions: fax: (______) _________ - _________ ds70657d DSPIC33EPXXXGP50X, dspi c33epxxxmc20x/50x, and pic24epxxxgp/mc20x 1. what are the best features of this document? 2. how does this document meet your hardware and software development needs? 3. do you find the organization of this document easy to follow? if not, why? 4. what additions to the document do you th ink would enhance the structure and subject? 5. what deletions from the document could be made without affecting the overall usefulness? 6. is there any incorrect or misleading information (what and where)? 7. how would you improve this document?
? 2011 microchip technology inc. preliminary ds70657d-page 501 DSPIC33EPXXXGP50X, dspic33ep xxxmc20x/50x, and pic24epxxxgp/mc20x product identification system to order or obtain information, e.g., on pricing or deliv ery, refer to the factory or the listed sales office . architecture: 33 = 16-bit digital signal controller 24 = 16-bit microcontroller flash memory family: ep = enhanced performance product group: gp = general purpose family mc = motor control family pin count: 02 = 28-pin 03 = 36-pin 04 = 44-pin 06 = 64-pin temperature range: i=-40 c to+85 c (industrial) e=-40 c to+125 c (extended) package: ml = plastic quad, no lead package - (44-pin) 8x8 mm body (qfn) mm = plastic quad, no lead package - (28-pin) 6x6 mm body (qfn-s) mr = plastic quad, no lead package - (64-pin) 9x9 mm body (qfn) pt = plastic thin quad flatpack - (44-pin) 10x10 mm body (tqfp) pt = plastic thin quad flatpack - (64-pin) 10x10 mm body (tqfp) so = plastic small outline, wide - (28-pin) 7.50 mil body (soic) sp = skinny plastic dual in-line - (28-pin) 300 mil body (spdip) ss = plastic shrink small outline - (28-pin) 5.30 mm body (ssop) tl = very thin leadless array - (36-pin) 5x5 mm body (vtla) tl = very thin leadless array - (44-pin) 6x6 mm body (vtla) examples: dspic33ep64mc504-i/pt: dspic33, enhanced performance, 64 kb program memory, motor control, 44-pin, industrial temperature, tqfp package. microchip trademark architecture flash memory family program memory size (kb) product group pin count temperature range package pattern dspic 33 ep 64 mc5 04 t i / p t - xxx tape and reel flag (if applicable)
DSPIC33EPXXXGP50X, ds pic33epxxxmc20x/50x, and pic24epxxxgp/mc20x ds70657d-page 502 preliminary ? 2011 microchip technology inc. notes:
? 2011 microchip technology inc. preliminary ds70657d-page 503 information contained in this publication regarding device applications and the like is prov ided only for your convenience and may be superseded by updates. it is your responsibility to ensure that your application me ets with your specifications. microchip makes no representations or warranties of any kind whether express or implied, written or oral, statutory or otherwise, related to the information, including but not limited to its condition, quality, performance, merchantability or fitness for purpose . microchip disclaims all liability arising from this information and its use. use of microchip devices in life support and/or safe ty applications is entirely at the buyer?s risk, and the buyer agrees to defend, indemnify and hold harmless microchip from any and all damages, claims, suits, or expenses resulting fr om such use. no licenses are conveyed, implicitly or ot herwise, under any microchip intellectual property rights. trademarks the microchip name and logo, th e microchip logo, dspic, k ee l oq , k ee l oq logo, mplab, pic, picmicro, picstart, pic 32 logo, rfpic and uni/o are registered trademarks of microchip technology incorporated in the u.s.a. and other countries. filterlab, hampshire, hi-tech c, linear active thermistor, mxdev, mxlab, seeval and the embedded control solutions company are register ed trademarks of microchip technology incorporated in the u.s.a. analog-for-the-digital age, application maestro, chipkit, chipkit logo, codeguard, dspicdem, dspicdem.net, dspicworks, dsspeak, ecan, economonitor, fansense, hi-tide, in-circuit serial programming, icsp, mindi, miwi, mpasm, mplab certified logo, mplib, mplink, mtouch, omniscient code generation, picc, picc-18, picdem, picdem.net, pickit, pictail, real ice, rflab, select mode, total endurance, tsharc, uniwindriver, wiperlock and zena are trademarks of microchip technology incorporated in the u.s.a. and other countries. sqtp is a service mark of mi crochip technology incorporated in the u.s.a. all other trademarks mentioned herein are property of their respective companies. ? 2011, microchip technology incorporated, printed in the u.s.a., all rights reserved. printed on recycled paper. isbn: 978-1-61341-924-3 note the following details of the code protection feature on microchip devices: ? microchip products meet the specification cont ained in their particular microchip data sheet. ? microchip believes that its family of products is one of the mo st secure families of its kind on the market today, when used i n the intended manner and under normal conditions. ? there are dishonest and possibly illegal meth ods used to breach the code protection fe ature. all of these methods, to our knowledge, require using the microchip pr oducts in a manner outside the operating specif ications contained in microchip?s data sheets. most likely, the person doing so is engaged in theft of intellectual property. ? microchip is willing to work with the customer who is concerned about the integrity of their code. ? neither microchip nor any other semiconduc tor manufacturer can guarantee the security of their code. code protection does not mean that we are guaranteeing the product as ?unbreakable.? code protection is constantly evolving. we at microchip are committed to continuously improving the code protection features of our products. attempts to break microchip?s c ode protection feature may be a violation of the digital millennium copyright act. if such acts allow unauthorized access to your softwa re or other copyrighted work, you may have a right to sue for relief under that act. microchip received iso/ts-16949:2009 certification for its worldwide headquarters, design and wafer fabrication facilities in chandler and tempe, arizona; gresham, oregon and design centers in california and india. the company?s quality system processes and procedures are for its pic ? mcus and dspic ? dscs, k ee l oq ? code hopping devices, serial eeproms, microperi pherals, nonvolatile memory and analog products. in addition, microchip?s quality system for the design and manufacture of development systems is iso 9001:2000 certified.
ds70657d-page 504 ? 2011 microchip technology inc. americas corporate office 2355 west chandler blvd. chandler, az 85224-6199 tel: 480-792-7200 fax: 480-792-7277 technical support: http://www.microchip.com/ support web address: www.microchip.com atlanta duluth, ga tel: 678-957-9614 fax: 678-957-1455 boston westborough, ma tel: 774-760-0087 fax: 774-760-0088 chicago itasca, il tel: 630-285-0071 fax: 630-285-0075 cleveland independence, oh tel: 216-447-0464 fax: 216-447-0643 dallas addison, tx tel: 972-818-7423 fax: 972-818-2924 detroit farmington hills, mi tel: 248-538-2250 fax: 248-538-2260 indianapolis noblesville, in tel: 317-773-8323 fax: 317-773-5453 los angeles mission viejo, ca tel: 949-462-9523 fax: 949-462-9608 santa clara santa clara, ca tel: 408-961-6444 fax: 408-961-6445 toronto mississauga, ontario, canada tel: 905-673-0699 fax: 905-673-6509 asia/pacific asia pacific office suites 3707-14, 37th floor tower 6, the gateway harbour city, kowloon hong kong tel: 852-2401-1200 fax: 852-2401-3431 australia - sydney tel: 61-2-9868-6733 fax: 61-2-9868-6755 china - beijing tel: 86-10-8569-7000 fax: 86-10-8528-2104 china - chengdu tel: 86-28-8665-5511 fax: 86-28-8665-7889 china - chongqing tel: 86-23-8980-9588 fax: 86-23-8980-9500 china - hangzhou tel: 86-571-2819-3187 fax: 86-571-2819-3189 china - hong kong sar tel: 852-2401-1200 fax: 852-2401-3431 china - nanjing tel: 86-25-8473-2460 fax: 86-25-8473-2470 china - qingdao tel: 86-532-8502-7355 fax: 86-532-8502-7205 china - shanghai tel: 86-21-5407-5533 fax: 86-21-5407-5066 china - shenyang tel: 86-24-2334-2829 fax: 86-24-2334-2393 china - shenzhen tel: 86-755-8203-2660 fax: 86-755-8203-1760 china - wuhan tel: 86-27-5980-5300 fax: 86-27-5980-5118 china - xian tel: 86-29-8833-7252 fax: 86-29-8833-7256 china - xiamen tel: 86-592-2388138 fax: 86-592-2388130 china - zhuhai tel: 86-756-3210040 fax: 86-756-3210049 asia/pacific india - bangalore tel: 91-80-3090-4444 fax: 91-80-3090-4123 india - new delhi tel: 91-11-4160-8631 fax: 91-11-4160-8632 india - pune tel: 91-20-2566-1512 fax: 91-20-2566-1513 japan - osaka tel: 81-66-152-7160 fax: 81-66-152-9310 japan - yokohama tel: 81-45-471- 6166 fax: 81-45-471-6122 korea - daegu tel: 82-53-744-4301 fax: 82-53-744-4302 korea - seoul tel: 82-2-554-7200 fax: 82-2-558-5932 or 82-2-558-5934 malaysia - kuala lumpur tel: 60-3-6201-9857 fax: 60-3-6201-9859 malaysia - penang tel: 60-4-227-8870 fax: 60-4-227-4068 philippines - manila tel: 63-2-634-9065 fax: 63-2-634-9069 singapore tel: 65-6334-8870 fax: 65-6334-8850 taiwan - hsin chu tel: 886-3-5778-366 fax: 886-3-5770-955 taiwan - kaohsiung tel: 886-7-536-4818 fax: 886-7-330-9305 taiwan - taipei tel: 886-2-2500-6610 fax: 886-2-2508-0102 thailand - bangkok tel: 66-2-694-1351 fax: 66-2-694-1350 europe austria - wels tel: 43-7242-2244-39 fax: 43-7242-2244-393 denmark - copenhagen tel: 45-4450-2828 fax: 45-4485-2829 france - paris tel: 33-1-69-53-63-20 fax: 33-1-69-30-90-79 germany - munich tel: 49-89-627-144-0 fax: 49-89-627-144-44 italy - milan tel: 39-0331-742611 fax: 39-0331-466781 netherlands - drunen tel: 31-416-690399 fax: 31-416-690340 spain - madrid tel: 34-91-708-08-90 fax: 34-91-708-08-91 uk - wokingham tel: 44-118-921-5869 fax: 44-118-921-5820 worldwide sales and service 11/29/11


▲Up To Search▲   

 
Price & Availability of DSPIC33EPXXXGP50X

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X